Opened 3 years ago

Closed 3 years ago

#27749 closed Cleanup/optimization (invalid)

Documention change gunicorn deployment

Reported by: JorisBenschop Owned by: nobody
Component: Documentation Version: 1.10
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no


In section "Running Django in Gunicorn as a generic WSGI application" there is the suggestion to run

gunicorn myproject.wsgi

However, on my server (CentOS7) at least, django-admin does not create a myproject.wsgi, but a Problem is that you cannot run


It will fail with the cryptic "Reason: Worker failed to boot.". Instead, one must run

gunicorn wsgi

(so without the .py extension)

I have not tested this on other setups, so it could be very specific. Still, would it be possible to make a mention of this behaviour in the django documentation?


Change History (3)

comment:1 Changed 3 years ago by Tim Graham

Resolution: worksforme
Status: newclosed

I think "gunicorn just needs to be called with the location of a module containing a WSGI application object named application" explains the usage well enough If that is unclear and you want to propose some clarification, please do.

comment:2 Changed 3 years ago by JorisBenschop

Resolution: worksforme
Status: closednew

well the doc highlights an example usage that crashes (despite that other text is correct. This difference in explanation creates a discrepancy and thus confusion). I think this could be improved. Therefore I suggest to replace the

gunicorn myproject.wsgi


gunicorn wsgi

comment:3 Changed 3 years ago by Marten Kenbeek

Resolution: invalid
Status: newclosed

The docs explicitly mention:

It requires that your project be on the Python path; the simplest way to ensure that is to run this command from the same directory as your file.

If your project is on your python path, the wsgi file has a relative location of myproject/ (at least when using the default project template). This translates to an import path of myproject.wsgi, so the documentation is correct.

If gunicorn myproject.wsgi can't find your wsgi file, it's because your python path does not contain the root of your project, or your wsgi file has a non-standard location.

Note: See TracTickets for help on using tickets.
Back to Top