def create_app(): app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join(_basedir, 'test.db') app.secret_key = 'super secret key' with app.test_request_context(): db.create_all() return app.test_client()
def create_app(): app.config['TESTING'] = True app.config['WTF_CSRF_ENABLED'] = False app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///' + os.path.join( _basedir, 'test.db') app.secret_key = 'super secret key' with app.test_request_context(): db.create_all() return app.test_client()
"""Copyright 2015 Rafal Kowalski""" from open_event import current_app from open_event.models import db if __name__ == "__main__": with current_app.app_context(): db.create_all() current_app.run(host='0.0.0.0', debug=True)