![]() ![]() This error arises Traceback (most recent call last):įile "/usr/local/lib/python3.5/dist-packages/gunicorn/arbiter.py", line 583, in spawn_workerįile "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 129, in init_processįile "/usr/local/lib/python3.5/dist-packages/gunicorn/workers/base.py", line 138, in load_wsgiįile "/usr/local/lib/python3.5/dist-packages/gunicorn/app/base.py", line 67, in wsgiįile "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 52, in loadįile "/usr/local/lib/python3.5/dist-packages/gunicorn/app/wsgiapp.py", line 41, in load_wsgiappįile "/usr/local/lib/python3.5/dist-packages/gunicorn/util.py", line 350, in import_appįile "/opt/slackbot/slackbot/slackbot.py", line 3, in įile "/opt/slackbot/slackbot/app/_init_.py", line 22, in create_appįile "/opt/slackbot/slackbot/app/acuity/_init_.py", line 5, in įile "/opt/slackbot/slackbot/app/acuity/routes.py", line 4, in įile "/opt/slackbot/slackbot/app/acuity/handlers.py", line 3, in įile "/opt/slackbot/slackbot/app/slackapi.py", line 10, in įile "/usr/local/lib/python3.5/dist-packages/werkzeug/local.py", line 377, in But if I try to use and reference current_app like this: import time If I try to from flask import current_app in app.slackapi it doesn't error. This is how I'm importing from acuity.handlers import dateutil.parser, datetime, os, json, requestsįrom jinja2 import Environment, FileSystemLoader What's the best way to put the slackapi and any other common utility functions or common libraries I make into the global flask context so that I can use them inside of any of the blueprints? I need to use the app context in order to access the logging and config vars. ![]() In acuity.handlers I'm importing in app.slackapi but can't use current_app no matter how I slice it. Main doesn't do anything and the only endpoints are in acuity. For example here is my app structure: ├── app I've been following app factories and using blueprints, but I'm having trouble figuring out how to use application wide libraries and keep the app context. I'm new with using flask so I'm doing a lot of research to find out what the best way to structure my application. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |