WebFaction
Community site: login faq

I have a couple WSGI application I created prior to the addition of the settings below.

WSGIProcessGroup [app-name]
WSGIRestrictEmbedded On
WSGILazyInitialization On

I just created a new WSGI application in the same manner as the others. When I tried to run it though I kept getting a 500 error, which was coming from a Python ImportError exception. It was unable to find my application's modules. I added the path to the WSGIPythonPath like I did with my other applications, but when I checked sys.path the new WSGIPythonPath wasn't there. I restarted the Apache process a couple times but it still wouldn't update. Finally, I removed the three newest settings, restarted Apache, and my sys.path immediately reflected the changes I had made before. I added the new settings back after verifying that my application works and it broke again with the same error. As a final test I put my application's path in the python-path argument of the WSGIDaemonProcess directive WITH the new settings and it all works.

I looked up these new settings and I didn't see anything saying they cause WSGIPythonPath to be ignored, but that appears to be the case from my experiences. Although, I didn't test this extensively so I'm probably missing some detail. Does anyone know what causes this? Why does WSGIPythonPath seem to get ignored when those three settings are present? Or if this isn't really the case could someone hypothesize as to what happened?

It's not a huge inconvenience, but it was a bit of a head-scratcher for a bit, because I thought I was forgetting a step from my previous applications.

Thanks!

asked 21 Nov '11, 06:45

BYG
1524
accept rate: 0%


Try it without the WSGILazyInitialization On entry. From what I read this doesn't enable the python interpreter right away which may be what is messing with your python path.

permanent link

answered 21 Nov '11, 12:23

bmeyer71 ♦♦
1.5k3613
accept rate: 33%

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:

×337
×62
×4
×1

question asked: 21 Nov '11, 06:45

question was seen: 4,275 times

last updated: 21 Nov '11, 12:23

WEBFACTION
REACH US
SUPPORT
AFFILIATE PROGRAM
LEGAL
© COPYRIGHT 2003-2020 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