def run_test_server(): """Used by the phantomjs tests to run a live testing server""" # running the server in debug mode during testing fails for some reason application.DEBUG = True application.TESTING = True port = application.config['LIVE_SERVER_PORT'] application.run(port=port, use_reloader=False, threaded=True)
def run_test_server(): """Used by the phantomjs tests to run a live testing server""" # running the server in debug mode during testing fails for some reason application.config['DEBUG'] = True application.config['TESTING'] = True port = application.config['TEST_SERVER_PORT'] # Don't use the production database but a temporary test database. application.config['SQLALCHEMY_DATABASE_URI'] = "sqlite:///test.db" database.create_all() database.session.commit() # Add a route that allows the test code to shutdown the server, this allows # us to quit the server without killing the process thus enabling coverage # to work. application.add_url_rule('/shutdown', 'shutdown', shutdown, methods=['POST', 'GET']) application.run(port=port, use_reloader=False, threaded=True) database.session.remove() database.drop_all()
from app.main import application if __name__ == "__main__": application.run(debug=True)
from app.main import application if __name__ == '__main__': application.run(host='0.0.0.0', debug=True)