config.py 991 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import os
  2. BASE_DIR = os.path.abspath(os.path.dirname(__file__))
  3. class Config:
  4. SECRET_KEY = os.getenv('SECRET_KEY', 'my_precious_secret_key')
  5. DEBUG = False
  6. class DevelopmentConfig(Config):
  7. # uncomment the line below to use postgres
  8. # SQLALCHEMY_DATABASE_URI = postgres_local_base
  9. DEBUG = True
  10. # SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'flask_boilerplate_test.db')
  11. # SQLALCHEMY_TRACK_MODIFICATIONS = False
  12. class TestingConfig(Config):
  13. DEBUG = True
  14. TESTING = True
  15. # SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(basedir, 'flask_boilerplate_test.db')
  16. PRESERVE_CONTEXT_ON_EXCEPTION = False
  17. # SQLALCHEMY_TRACK_MODIFICATIONS = False
  18. class ProductionConfig(Config):
  19. DEBUG = False
  20. # uncomment the line below to use postgres
  21. # SQLALCHEMY_DATABASE_URI = postgres_local_base
  22. config_by_name = dict(
  23. dev=DevelopmentConfig,
  24. test=TestingConfig,
  25. prod=ProductionConfig
  26. )
  27. key = Config.SECRET_KEY