for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
import logging
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
class SomeClass: def some_method(self): """Do x and return foo."""
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.
from logging import StreamHandler
import os
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
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'))
HOST = "0.0.0.0"
PORT = 5000
class UnitTestingConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = (os.environ.get('TEST_DATABASE_URL') or
'sqlite:///' + os.path.join(basedir, 'data-test.sqlite'))
class IntegrationTestingConfig(Config):
class ProductionConfig(Config):
SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL')
@classmethod
def init_app(cls, app):
file_handler = StreamHandler()
file_handler.setLevel(logging.WARNING)
app.logger.addHandler(file_handler)
config = {
"development": DevelopmentConfig,
"unit_testing": UnitTestingConfig,
"integration_testing": IntegrationTestingConfig,
"production": ProductionConfig,
"default": DevelopmentConfig
}
The coding style of this project requires that you add a docstring to this code element. Below, you find an example for methods:
If you would like to know more about docstrings, we recommend to read PEP-257: Docstring Conventions.