Opened 6 years ago

Closed 6 years ago

#11344 closed (fixed)

Update Documentation About Mod-wsgi/django installation

Reported by: nartzpod Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Accepted
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


In this page of the docs:

When install mod-wsgi, it says:

import os
import sys

os.environ['DJANGO_SETTINGS_MODULE'] = 'mysite.settings'

import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()

If your project is not on your PYTHONPATH by default you can add:


just above the import line to place your project on the path. Remember to replace 'mysite.settings' with your correct settings file.

  1. It says that the code sys.path.append('/usr/local/django') should be added above the import statement; this is ambiguous, because there are in fact 3 import statements - it should specify above the 'import django.core.handlers.wsgi' statement but below the other two import statements
  1. It says to put sys.path.append('/usr/local/django') ; however, instead, it should say to put a link to where your python path is stored, i.e. sys.path.append('/path/to/django'), because not everyone symlinks their stuff into /usr/local/django; instead, it should suggest finding the python path and putting it in here; to find the python path, type python, then import django, then type django, and use that path.


Change History (2)

comment:1 Changed 6 years ago by kmtracey

  • Component changed from Uncategorized to Documentation
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Note the sys.append is for placing your project's path into the python path, not the path to django itself. If someone has figured out how to get as far as trying to deploy with mod_wsgi without having django in the default python path, they likely aren't going to need detailed instructions on finding it, so I think the 2nd point can be effectively dealt with by adding a note similar to the one for mysite.settings, which should also serve to reinforce that the path being talked about here is the project path.

comment:2 Changed 6 years ago by kmtracey

  • Resolution set to fixed
  • Status changed from new to closed

(In [11080]) [1.0.X] Fixed #11344 -- Made a couple of minor clarifications to the mod_wsgi deployment doc. Thanks nartzpod and achew22.

r11079 from trunk.

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