from project import app from project.application import configure_app from project.config import ProductionConfig configure_app(app, ProductionConfig()) if __name__ == '__main__': app.run(host='0.0.0.0', port=8080)
def product(): configure_app(app, ProductionConfig())
def import_local_config_file(filename): if not os.path.isabs(filename): filename = os.path.join(os.getcwd(), filename) configure_app(app, filename, is_pyfile=True)
def develop(): configure_app(app, DevelopmentConfig())
#!/usr/bin/env python # -*- coding: utf-8 -*- # find . -name \*.pyc -delete # project imports from project import app from project.application import configure_app from project.config import DeploymentConfig configure_app(app, DeploymentConfig) if __name__ == '__main__': app.run(host='0.0.0.0', port=8080)
def custom_config(config_file): """ Run server on port 8080 with custom config file. """ configure_app(app, os.path.abspath(config_file), is_pyfile=True) app.run(host='0.0.0.0', port=8080)
def testing(): """ Run server on port 8080 with testing config. """ configure_app(app, TestingConfig) app.run(host='0.0.0.0', port=8080)
def deploy(): """ Run server on port 8080 with deployment config. """ configure_app(app, DeploymentConfig) app.run(host='0.0.0.0', port=8080)