config.py 793 B

123456789101112131415161718192021222324252627282930313233
  1. import os
  2. BASEDIR = os.path.abspath(os.path.dirname(__file__))
  3. TOP_LEVEL_DIR = os.path.abspath(os.curdir)
  4. class Config(object):
  5. DEBUG = False
  6. TESTING = False
  7. CSRF_ENABLED = True
  8. SECRET_KEY = os.environ.get('SECRET_KEY') or 'add-your-random-key-here'
  9. S3_BUCKET = os.environ.get('S3_BUCKET')
  10. S3_KEY = os.environ.get('S3_KEY')
  11. S3_SECRET = os.environ.get('S3_SECRET_ACCESS_KEY')
  12. S3_LOCATION = 'http://{}.s3.amazonaws.com/'.format(S3_BUCKET)
  13. ALLOWED_EXTENSIONS = set(['txt', 'pdf', 'png', 'jpg', 'jpeg', 'gif'])
  14. class ProductionConfig(Config):
  15. DEBUG = False
  16. class StagingConfig(Config):
  17. DEVELOPMENT = True
  18. DEBUG = True
  19. class DevelopmentConfig(Config):
  20. DEVELOPMENT = True
  21. DEBUG = True
  22. class TestingConfig(Config):
  23. TESTING = True