Opened 7 years ago

Closed 6 years ago

#15058 closed Bug (wontfix)


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


I was struggling with getting WSGI up until I found the following:

If you have been using the Django development server and have made use of the fact that it is possible when doing explicit imports, or when referencing modules in '', to leave out the name of the site and use a relative module path, you will also need to add to sys.path the path to the site package directory itself.

sys.path.append('/usr/local/django/mysite') # This part


Attachments (1)

15058.diff (1.4 KB) - added by Aymeric Augustin 7 years ago.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 7 years ago by Russell Keith-Magee

Resolution: wontfix
Status: newclosed

I'm going to mark this wontfix --

  • It's a mod_wsgi configuration issue
  • Django's mod_wsgi docs state (correctly) that you need to have the project PYTHONPATH configured
  • The mod_wsgi Django docs describe this specific issue and the solution
  • Django's mod_wsgi docs points at the mod_wsgi Django docs

comment:2 Changed 7 years ago by Russell Keith-Magee

Component: UncategorizedDocumentation
Resolution: wontfix
Status: closedreopened
Triage Stage: UnreviewedAccepted

No - wait - on second reading -- our docs could be a little clearer. It isn't (necessarily) as simple as just putting the second entry in your PYTHONPATH, but that will be a common solution.

Changed 7 years ago by Aymeric Augustin

Attachment: 15058.diff added

comment:3 Changed 7 years ago by Aymeric Augustin

Russell, I just attached a proposal, but I'm not sure it is what you had in mind.

It should at least be more beginner-friendly than the current doc.

comment:4 Changed 7 years ago by Graham Dumpleton

Please be careful about using the reference to 'PYTHONPATH' in documentation related to mod_wsgi setup. People know 'PYTHONPATH' as the environment variable used in command line Python and occasionally have seen people think that because it was mentioned and because they had already set 'PYTHONPATH' in the user environment that everything will work under Apache. This will not be the case because Apache/mod_wsgi runs as different user and will not inherit the users environment. I would personally therefore like to see any mention of 'PYTHONPATH' dropped and simple refer to it as something """Python module search path as defined by 'sys.path'""" or something else similar.

And yes I have been lazy in still not adding a separate page to the mod_wsgi documentation explaining better the whole sys.path, module search path stuff. :-)

comment:5 Changed 7 years ago by Aymeric Augustin

#15526 was closed as duplicate.

comment:6 Changed 7 years ago by Aymeric Augustin

#12056 is related. It suggests changing the code and not just the docs. It contains comments by core developers.

comment:7 Changed 7 years ago by anonymous

Severity: Normal
Type: Bug

comment:8 Changed 7 years ago by Aymeric Augustin

Easy pickings: unset
UI/UX: unset

#16564 was closed as duplicate.

comment:9 Changed 7 years ago by Aymeric Augustin

#16673 was closed as a duplicate.

comment:10 Changed 6 years ago by Tim Graham

Resolution: wontfix
Status: reopenedclosed

I believe this is no longer relevant after r17022

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