No module named wsgi

Jahongir Rahmonov picture Jahongir Rahmonov · May 25, 2015 · Viewed 11.8k times · Source

This is what I have in my Procfile:

web: gunicorn --pythonpath meraki meraki.wsgi

and when I do foreman start, I get this error:

gunicorn.errors.HaltServer: <HaltServer 'Worker failed to boot.' 3>

the reason, as far as I can see in the traceback, is:

ImportError: No module named wsgi

I did import wsgi in the shell and the import was successful, no errors.

Why can't I start foreman?

Project Structure:

meraki
  meraki
      //other apps
      meraki
          settings
          __init__.py
          celery.py
          views.py
          wsgi.py
      manage.py
  Procfile
  requirements
  requirements.txt

Answer

Daniel Roseman picture Daniel Roseman · May 25, 2015

You've confused yourself by following an unnecessarily complicated structure. You don't need that outer meraki directory, and your Procfile and requirements.txt should be in the same directory as manage.py. Then you can remove the pythonpath parameter and all should be well.