Advertisement
vsokoltsov

Untitled

Jan 4th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.05 KB | None | 0 0
  1. import os
  2. basedir = os.path.abspath(os.path.dirname(__file__))
  3.  
  4. class Config(object):
  5. DEBUG = False
  6. TESTING = False
  7. CSRF_ENABLED = True
  8. DB_NAME = 'idea360'
  9. SECRET_KEY = os.environ.get('JWT_SECRET')
  10. SQLALCHEMY_ACCESS = 'postgresql://postgres:{}@postgres'.format(
  11. os.environ.get('POSTGRES_PASSWORD')
  12. )
  13. SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:{}@postgres/{}'.format(
  14. os.environ.get('POSTGRES_PASSWORD'), DB_NAME
  15. )
  16.  
  17.  
  18. class ProductionConfig(Config):
  19. DEBUG = False
  20.  
  21.  
  22. class StagingConfig(Config):
  23. DEVELOPMENT = True
  24. DEBUG = True
  25.  
  26.  
  27. class DevelopmentConfig(Config):
  28. DEVELOPMENT = True
  29. DEBUG = True
  30.  
  31.  
  32. class TestingConfig(Config):
  33. TESTING = True
  34. DEBUG = False
  35. DB_NAME = 'idea360_test'
  36. PRESERVE_CONTEXT_ON_EXCEPTION = False
  37. SQLALCHEMY_DATABASE_URI = 'postgresql://postgres:{}@postgres/{}'.format(
  38. os.environ.get('POSTGRES_PASSWORD'), DB_NAME
  39. )
  40.  
  41. app_config = {
  42. 'development': DevelopmentConfig,
  43. 'test': TestingConfig
  44. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement