+++ /dev/null
-import os
-basedir = os.path.abspath(os.path.dirname(__file__))
-
-
-class Config:
- SECRET_KEY = os.environ.get('SECRET_KEY') or 'this is the lp2 secret'
- SQLALCHEMY_COMMIT_ON_TEARDOWN = True
-
- @staticmethod
- def init_app(app):
- pass
-
-class DevelopmentConfig(Config):
- DEBUG = True
- SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
- 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
-
-class ProductionConfig(Config):
- SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
- 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
-
- @classmethod
- def init_app(cls, app):
- Config.init_app(app)
-
-class HerokuConfig(ProductionConfig):
- SSL_DISABLE = bool(os.environ.get('SSL_DISABLE'))
- DEBUG = True
-
- @classmethod
- def init_app(cls, app):
- ProductionConfig.init_app(app)
-
- # handle proxy server headers
- from werkzeug.contrib.fixers import ProxyFix
- app.wsgi_app = ProxyFix(app.wsgi_app)
-
- # log to stderr
- import logging
- from logging import StreamHandler
- file_handler = StreamHandler()
- file_handler.setLevel(logging.WARNING)
- app.logger.addHandler(file_handler)
-
-
-config = {
- 'development': DevelopmentConfig,
- 'production': ProductionConfig,
- 'heroku': HerokuConfig,
-
- 'default': DevelopmentConfig
-}
\ No newline at end of file
class Config:
- SECRET_KEY = os.environ.get('SECRET_KEY') or 'this is the lp2 secret'
- SQLALCHEMY_COMMIT_ON_TEARDOWN = True
+ SECRET_KEY = os.environ.get('SECRET_KEY') or 'this is the lp2 secret'
+ SQLALCHEMY_COMMIT_ON_TEARDOWN = True
- @staticmethod
- def init_app(app):
- pass
+ @staticmethod
+ def init_app(app):
+ pass
class TestConfig(Config):
DEBUG = False
- SQLALCHEMY_DATABASE_URI = 'sqlite://'
+ SQLALCHEMY_DATABASE_URI = 'sqlite://'
TESTING = True
WTF_CSRF_ENABLED = False
LOGIN_DISABLED = False
class DevelopmentConfig(Config):
- DEBUG = True
- SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
- 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
+ DEBUG = True
+ SQLALCHEMY_DATABASE_URI = os.environ.get('DEV_DATABASE_URL') or \
+ 'sqlite:///' + os.path.join(basedir, 'data-dev.sqlite')
class ProductionConfig(Config):
- SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
- 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
+ SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
+ 'sqlite:///' + os.path.join(basedir, 'data.sqlite')
- @classmethod
- def init_app(cls, app):
- Config.init_app(app)
+ @classmethod
+ def init_app(cls, app):
+ Config.init_app(app)
class HerokuConfig(ProductionConfig):
- SSL_DISABLE = bool(os.environ.get('SSL_DISABLE'))
- DEBUG = True
+ SSL_DISABLE = bool(os.environ.get('SSL_DISABLE'))
+ DEBUG = True
- @classmethod
- def init_app(cls, app):
- ProductionConfig.init_app(app)
+ @classmethod
+ def init_app(cls, app):
+ ProductionConfig.init_app(app)
- # handle proxy server headers
- from werkzeug.contrib.fixers import ProxyFix
- app.wsgi_app = ProxyFix(app.wsgi_app)
+ # handle proxy server headers
+ from werkzeug.contrib.fixers import ProxyFix
+ app.wsgi_app = ProxyFix(app.wsgi_app)
- # log to stderr
- import logging
- from logging import StreamHandler
- file_handler = StreamHandler()
- file_handler.setLevel(logging.WARNING)
- app.logger.addHandler(file_handler)
+ # log to stderr
+ import logging
+ from logging import StreamHandler
+ file_handler = StreamHandler()
+ file_handler.setLevel(logging.WARNING)
+ app.logger.addHandler(file_handler)
config = {
- 'development': DevelopmentConfig,
- 'production': ProductionConfig,
- 'heroku': HerokuConfig,
- 'test': TestConfig,
+ 'development': DevelopmentConfig,
+ 'production': ProductionConfig,
+ 'heroku': HerokuConfig,
+ 'test': TestConfig,
- 'default': DevelopmentConfig
+ 'default': DevelopmentConfig
}