WebFaction
Community site: login faq

Hi,

My english is poor, so excuse me with my orthograph.

I have setup two django applications. Now, i want to set a different WSGIPythoonPath for both of them.

Here is my code to show how a procedded (in httpd.conf)

Production Port

Listen 8888

Test Port

Listen 8889

NameVirtualHost 192.168.2.5:8888

NameVirtualHost 192.168.2.5:8889

PRODUCTION

WSGIPythonPath D:/_ApplicationLegare/RegLeg-Prod <virtualhost 192.168.2.5:8888="">

WSGIScriptAlias / D:/_ApplicationLegare/RegLeg-Prod/project/wsgi.py

<Directory D:/_ApplicationLegare/RegLeg-Prod/project>
    Order deny,allow
    Allow from all
</Directory>

Alias /static/ D:/_ApplicationLegare/RegLeg-Prod/project/static/
<Directory D:/_ApplicationLegare/RegLeg-Prod/project/static/>
    Order deny,allow
    Allow from all
</Directory>
</virtualhost>

TEST (Copie de PRODUCTION)

WSGIPythonPath D:/_ApplicationLegare/RegLeg-Test <virtualhost 192.168.2.5:8889="">

WSGIScriptAlias / D:/_ApplicationLegare/RegLeg-Test/project/wsgi.py

<Directory D:/_ApplicationLegare/RegLeg-Test/project>
    Order deny,allow
    Allow from all
</Directory>

Alias /static/ D:/_ApplicationLegare/RegLeg-Test/project/static/
<Directory D:/_ApplicationLegare/RegLeg-Test/project/static/>
    Order deny,allow
    Allow from all
</Directory>
</virtualhost>

The problem is that the WSGIPythonPath is always pointing to "D:/_ApplicationLegare/RegLeg-Test" either i use 8888 or 8889 as a port ...

Putting WSGIPythonPath inside the virtualenv gives me an error message : "WSGIPythonPath cannot occur within VirtualHost section "

How can i use WSGIPythonPath inside VirtualHost or is there is an other way to do this ?

Thanks !

This question is marked "community wiki".

asked 18 Dec '13, 14:20

julien_drole...
11113
accept rate: 0%


It looks like you're running an application on your local system, and not on WebFaction servers, so I'm not sure what kind of setup you're using.

WSGIPythonPath can only be used in mod_wsgi is running in embedded mode. As the message says, it can't be used within a VirtualHost

mod_wsgi apps installed via our control panel are configured to use daemon mode, for which you can configure the Python search path by setting the python-path parameter for the WSGIDaemonProcess directive. This directive can be used with a VirtualHost. An example is available in our documentation: Adding to sys.path from httpd.conf

Hope that helps!

permanent link

answered 18 Dec '13, 17:48

seanf
12.2k41836
accept rate: 37%

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:

×909
×337
×4

question asked: 18 Dec '13, 14:20

question was seen: 10,512 times

last updated: 18 Dec '13, 17:48

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