Skip to content
Snippets Groups Projects
Select Git revision
  • a187ac33fa1892b1f633f9e19be0a4dd092e4765
  • master default
  • add-challenge
  • add-chall
4 results

config.py

Blame
  • Forked from Hodor Security Project / Hodor Web Backend
    Source project has a limited visibility.
    config.py 1.12 KiB
    # coding=utf-8
    import os
    
    
    class Config(object):
        """Parent configuration class."""
        DEBUG = False
        CSRF_ENABLED = True
        TESTING = False
        SECRET = os.getenv('SECRET')
        SQLALCHEMY_DATABASE_URI = os.getenv('DATABASE_URL')
    
    
    class DevelopmentConfig(Config):
        """Configurations for Development."""
        DEBUG = True
        SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/hodor_test'
        SECRET = "ChangeThisStringIfYouWant"
        TESTING = True
    
    
    class TestingConfig(Config):
        """Configurations for Testing, with a separate test database."""
        TESTING = True
        SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/test_db'
        DEBUG = True
        SECRET = 'ChangeMeMaybe'
    
    
    class StagingConfig(Config):
        """Configurations for Staging."""
        DEBUG = True
    
    
    class ProductionConfig(Config):
        """Configurations for Production."""
        DEBUG = False
        TESTING = False
        SQLALCHEMY_DATABASE_URI = 'postgresql://localhost/hodor_prod'
        SECRET = "TODO: ChangeMeInProduction"
    
    
    app_config = {
        'development': DevelopmentConfig,
        'testing': TestingConfig,
        'staging': StagingConfig,
        'production': ProductionConfig,
    }