gunicorn
gunicorn copied to clipboard
Integrate with django project [label studio]
Hi,
I'm trying to integrate label_studio with gnicorn.
as per the documentation, this simple command should work.
gunicorn --bind 0.0.0.0:8000 label_studio.wsgi
but i see
ModuleNotFoundError: No module named 'label_studio'
Why is keep saying module missing? I tried with django helo world project and it works fine.
what i noticed is was, label_studio
doesn't have wsgi.py. i tried creating one though, but it had same module missing
error.
There is a requirement for the DJANGO_SETTINGS_MODULE
environment variable.
Just set the environment variable to the settings file as a python module
- Linux
export DJANGO_SETTINGS_MODULE=label_studio.settings
- Windows
setx DJANGO_SETTINGS_MODULE "label_studio.settings"
Also, make sure to be in the root project while running the gunicorn
command so as to recognize the settings module as per the configuration. You can also find a similar issue here.