R
Railwayβ€’11mo ago
Elibe

Gunicorn failed to load the wsgi module

Hey everyone, I hope you're all doing well. I'm currently working on a Django project, and I've encountered an issue when trying to run it with Gunicorn. I would greatly appreciate your assistance in resolving this problem. Issue Description: I'm trying to deploy my Django application using Gunicorn, but I'm encountering a 'ModuleNotFoundError' related to the wsgi 'locallibrary' module. It seems that Gunicorn cannot find the wsgi path. As a developer I need to say it working on my machine πŸ˜‹ so I can guess it related to the python server path - but i dont know how to see the project structure inside the railway... my project id: 9bc78e3f-4204-46e6-8951-eadca9c6f04f
No description
29 Replies
Percy
Percyβ€’11mo ago
Project ID: 9bc78e3f-4204-46e6-8951-eadca9c6f04f
Brody
Brodyβ€’11mo ago
it works locally, but does it work locally with gunicorn?
Elibe
Elibeβ€’11mo ago
Yep I tried to change the path and got the same error so I guess it because the railway deployment use different paths structure then me. But as I said, I don't know how to access the project structure itself...
Brody
Brodyβ€’11mo ago
not sure how much help we can provide since this is a code issue, but send your deployment logs and maybe we will see something simple https://bookmarklets.up.railway.app/log-downloader/
Brody
Brodyβ€’11mo ago
ModuleNotFoundError: No module named 'locallibrary'
ModuleNotFoundError: No module named 'locallibrary'
Elibe
Elibeβ€’11mo ago
I saw it, but it related to the wsgi loading. Look at this row: File "/opt/venv/lib/python3.11/site-packages/gunicorn/arbiter.py", line 609, in spawn_worker The venv doesn't exist inside the project - it exist in the opt folder and I think it railway folder infra because I dont have any folder with this name...
Brody
Brodyβ€’11mo ago
please tackle this problem first
Elibe
Elibeβ€’11mo ago
This is the same problem, the wsgi lloading failed because the import failure. This is my project structure: crm β”œβ”€ .gitignore β”œβ”€ Procfile β”œβ”€ crm β”‚ β”œβ”€ asgi.py β”‚ β”œβ”€ settings.py β”‚ β”œβ”€ urls.py β”‚ └─ wsgi.py β”œβ”€ manage.py β”œβ”€ requirements.txt β”œβ”€ runtime.txt └─ website β”œβ”€ admin.py β”œβ”€ apps.py β”œβ”€ forms.py β”œβ”€ models.py β”œβ”€ templates β”‚ └─ test.html β”œβ”€ tests.py β”œβ”€ urls.py └─ views.py wsgi file: os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'crm.settings') application = get_asgi_application() Procfile: web: manage.py makemigrations && python manage.py migrate && python manage.py collectstatic --no-input && gunicorn crm.wsgi
Brody
Brodyβ€’11mo ago
have you fixed this error?
Elibe
Elibeβ€’11mo ago
This is the error 😒 I just say the source of it came from the problem with wsgi and Idk how to solve it
Brody
Brodyβ€’11mo ago
do you have locallibrary in your requirements.txt?
Elibe
Elibeβ€’11mo ago
no, and not in all my project, idk from where it come I try to search it in all my file without any clue
Brody
Brodyβ€’11mo ago
Elibe
Elibeβ€’11mo ago
pip install locallibrary ERROR: Could not find a version that satisfies the requirement locallibrary (from versions: none) ERROR: No matching distribution found for locallibrary
Want results from more Discord servers?
Add your server