gunicorn icon indicating copy to clipboard operation
gunicorn copied to clipboard

Integrate with django project [label studio]

Open subbaraoganeshna opened this issue 2 years ago • 1 comments

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.

subbaraoganeshna avatar Aug 17 '22 14:08 subbaraoganeshna

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.

Mr-Destructive avatar Aug 17 '22 14:08 Mr-Destructive