Opened 14 years ago

Closed 12 years ago

#15058 closed Bug (wontfix)

sys.path.append()

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

Description

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 'urls.py', 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')
sys.path.append('/usr/local/django/mysite') # This part

Reference:

http://code.google.com/p/modwsgi/wiki/IntegrationWithDjango

Attachments (1)

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

Download all attachments as: .zip

Change History (11)

comment:1 by Russell Keith-Magee, 14 years ago

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 by Russell Keith-Magee, 14 years ago

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.

by Aymeric Augustin, 14 years ago

Attachment: 15058.diff added

comment:3 by Aymeric Augustin, 14 years ago

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 by Graham Dumpleton, 14 years ago

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 by Aymeric Augustin, 14 years ago

#15526 was closed as duplicate.

comment:6 by Aymeric Augustin, 14 years ago

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

comment:7 by anonymous, 14 years ago

Severity: Normal
Type: Bug

comment:8 by Aymeric Augustin, 13 years ago

Easy pickings: unset
UI/UX: unset

#16564 was closed as duplicate.

comment:9 by Aymeric Augustin, 13 years ago

#16673 was closed as a duplicate.

comment:10 by Tim Graham, 12 years ago

Resolution: wontfix
Status: reopenedclosed

I believe this is no longer relevant after r17022

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