python - Debugging a Flask app under gunicorn with PyCharm -


i'd single-step through hello-world flask app running under gunicorn pycharm ce.

the app usual 5-10 liner sitting in /tmp/hello-world/app, , venv in /tmp/env.

my pycharm configuration looks this:

script: /tmp/env/bin/gunicorn script parameters: /tmp/hello-world/app:app working directory: /tmp/hello-world 

the app runs fine command line in venv using gunicorn app:app, when launch server under pycharm ce, import internal gunicorn fails:

traceback (most recent call last):   file "/tmp/env/lib/python2.7/site-packages/gunicorn/arbiter.py", line 578, in spawn_worker     worker.init_process()   file "/tmp/env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 126, in init_process     self.load_wsgi()   file "/tmp/env/lib/python2.7/site-packages/gunicorn/workers/base.py", line 135, in load_wsgi     self.wsgi = self.app.wsgi()   file "/tmp/env/lib/python2.7/site-packages/gunicorn/app/base.py", line 67, in wsgi     self.callable = self.load()   file "/tmp/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load     return self.load_wsgiapp()   file "/tmp/env/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp     return util.import_app(self.app_uri)   file "/tmp/env/lib/python2.7/site-packages/gunicorn/util.py", line 352, in import_app     __import__(module) importerror: import filename not supported. 

solutions don't work:

the error pretty clear. you're trying import file name giving file path. try changing script parameters app:app , should work.


Comments

Popular posts from this blog

ios - MKAnnotationView layer is not of expected type: MKLayer -

ZeroMQ on Windows, with Qt Creator -

unity3d - Unity SceneManager.LoadScene quits application -