D
D
Domohod2022-01-23 17:42:27
Python
Domohod, 2022-01-23 17:42:27

Why the error: ModuleNotFoundError: No module named 'Project.wsgi'?

I'm making a Django website and trying to put it out for testing using Heroku.

When going to the site - the error " Application error ".
This is what cmd gave out:

app[web.1]: ModuleNotFoundError: No module named 'Project.wsgi'
 app[web.1]: [2022-01-23 14:32:06 +0000] [9] [INFO] Worker exiting (pid: 9)
 app[web.1]: [2022-01-23 14:32:06 +0000] [4] [INFO] Shutting down: Master
 app[web.1]: [2022-01-23 14:32:06 +0000] [4] [INFO] Reason: Worker failed to boot.
2022-01-23T14:32:40.484247+00:00 heroku[router]: at=error code=H10 desc="App crashed" method=GET path="/" host=test-my-site-id.herokuapp.com request_id=a7bef83d-3b60-40af-8859-926464542343 fwd="37.144.197.49" dyno= connect= service= status=503 bytes= protocol=https


The error itself is App crashed, but I think it's due to the ModuleNotFoundError line. This is strange because the Procfile is located in the root folder and the folder containing the wsgi.py file is correct in the code.

Procfile:
web: gunicorn Project.wsgi --log-file -

Help me fix this error.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Domohod, 2022-02-02
@Domohod

Solution: change file path

web: sh -c 'cd папка_проекта && gunicorn приложение_с_wsgi.wsgi --log-file=-'

or
web: sh -c 'cd папка_проекта && gunicorn приложение_с_wsgi.wsgi --log-file=-'

D
Dr. Bacon, 2022-01-23
@bacon

ModuleNotFoundError: No module named 'Project.wsgi
because it is not in the paths, in which python is looking for it, you need to take it to read the docks, which once and for all figure out how python finds modules.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question