wsgi is particular about the app object

This commit is contained in:
mcbloch 2022-05-02 18:25:54 +02:00
parent fec9d660c3
commit dfbf1de5a1
3 changed files with 4 additions and 4 deletions

View file

@ -165,10 +165,10 @@ def create_app():
add_routes(app) add_routes(app)
add_template_filters(app) add_template_filters(app)
return app_manager return app, app_manager
# For usage when you directly call the script with python # For usage when you directly call the script with python
if __name__ == "__main__": if __name__ == "__main__":
app_mgr = create_app() app, app_mgr = create_app()
app_mgr.run() app_mgr.run()

View file

@ -4,7 +4,7 @@ import add_admins
from app import create_app, db from app import create_app, db
app_manager = create_app() app, app_manager = create_app()
entry_sets = { entry_sets = {
"admins": add_admins.add, "admins": add_admins.add,

View file

@ -20,7 +20,7 @@ sys.path.append(os.getcwd())
# and the WSGI object to be called `application` # and the WSGI object to be called `application`
from app import create_app from app import create_app
application = create_app() application, appmgr = create_app()
# For running on the server with passenger etc # For running on the server with passenger etc
if __name__ == "__main__": if __name__ == "__main__":