WebFaction
Community site: login faq

So I'm confused. If httpd.conf lists...

python-path=/home/user/webapps/myapp:/home/user/webapps/myapp/lib/python2.6 threads=1
WSGIPythonPath /home/user/webapps/myapp:/home/user/webapps/myapp/lib/python2.6
WSGIScriptAlias / /home/user/webapps/myapp/myapp.wsgi

and wsgi has...

sys.path = ['/home/user/webapps/myapp'] + sys.path

When I...

python2.6 /home/user/webapps/myapp/mymodule/manage.py shell
import sys
print(sys.path)

I don't see /home/user/webapps/myapp in the list, but only /home/user/webapps/myapp/mymodule.... why?!?

asked 21 Dec '10, 15:58

edbdfish
112
accept rate: 0%

edited 21 Dec '10, 16:03


The WSGI file is only processed when apache is ran. You will have to add the paths you need to the system environment. Our documentation covers how to do this,

http://docs.webfaction.com/software/python.html#adding-to-pythonpath-from-the-command-line

permanent link

answered 21 Dec '10, 17:20

johns
5.3k312
accept rate: 23%

As @johns said, you'll have to have your Python path set up prior to executing the WSGI file. I suggest you have a look at Spawning or other WSGI server alternatives that are more pythonic than apache+mod_wsgi.

(23 Dec '10, 14:57) Filip Dupanovic
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×908
×337
×15

question asked: 21 Dec '10, 15:58

question was seen: 3,750 times

last updated: 23 Dec '10, 14:58

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2019 SWARMA LIMITED - WEBFACTION IS A SERVICE OF SWARMA LIMITED
REGISTERED IN ENGLAND AND WALES 5729350 - VAT REGISTRATION NUMBER 877397162
5TH FLOOR, THE OLD VINYL FACTORY, HAYES, UB3 1HA, UNITED KINGDOM