ImportError: there is no module named my_project.wsgi with the launch of the wizard

I am trying to push my project into a hero and I follow these instructions:

https://devcenter.heroku.com/articles/getting-started-with-django

I am currently stuck on the part of foreman start

I get this error: → full error http://dpaste.com/3Y213Y2

 (boothie.0.1)MTVL1289dd026:HerokuBoothie bli1$ foreman start 14:59:05 web.1 | started with pid 58353 14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58353] [INFO] Starting gunicorn 19.1.1 14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58353] [INFO] Listening at: http://0.0.0.0:5000 (58353) 14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58353] [INFO] Using worker: sync 14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58356] [INFO] Booting worker with pid: 58356 14:59:05 web.1 | [2014-12-09 14:59:05 -0800] [58356] [ERROR] Exception in worker process: 14:59:05 web.1 | Traceback (most recent call last): 14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/arbiter.py", line 507, in spawn_worker 14:59:05 web.1 | worker.init_process() 14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/workers/base.py", line 114, in init_process 14:59:05 web.1 | self.wsgi = self.app.wsgi() 14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/app/base.py", line 66, in wsgi 14:59:05 web.1 | self.callable = self.load() 14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 65, in load 14:59:05 web.1 | return self.load_wsgiapp() 14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/app/wsgiapp.py", line 52, in load_wsgiapp 14:59:05 web.1 | return util.import_app(self.app_uri) 14:59:05 web.1 | File "/Users/bli1/Development/Django/HerokuBoothie/boothie.0.1/lib/python2.7/site-packages/gunicorn/util.py", line 356, in import_app 14:59:05 web.1 | __import__(module) 14:59:05 web.1 | ImportError: No module named HerokuBoothie.wsgi 

Here is an image of my project structure. The project is located inside the HerokuBoothie catalog. enter image description here

Profile:

web: gunicorn HerokuBoothie.wsgi --log-file -

+6
source share
2 answers

I think this is due to your project structure; if you follow the heroku guide that you have an error ( foreman start part), your directory structure will look like this:

 hellodjango/ manage.py Procfile hellodjango/ __init__.py settings.py urls.py wsgi.py venv/ bin/ include/ lib/ 

You can see that your structure is a little different; your structure has an additional HerokuBoothie directory. I think restructuring your project (something like mv ~/Development/Django/HerokuBoothie/HerokuBoothie/* ~/Development/Django/HerokuBoothie and removing the empty HerokuBoothie dir) will solve this problem, but you may have to change some codes if you use absolute paths in your codes.

+2
source

You have to install pythonpath since your HerokuBoothie module is in a different folder:

 web: gunicorn HerokuBoothie.wsgi --pythonpath ../HerokuBoothie --log-file - 
+2
source

Source: https://habr.com/ru/post/979369/


All Articles