WebFaction
Community site: login faq

When setting up a new Python/WSGI application for Flask in Webfaction why does:

WSGIPythonPath /home/me/webapps/myapp/abc

not work (I get a HTTP 500 error and the logs show ImportError: no module named x), instead in the index.py I have to put:

sys.path.insert(0,'/home/me/webapps/myapp/abc')

before the line

from x import app as application

This feels a bit "dirty"?

asked 24 May '12, 14:59

richbeales
111
accept rate: 0%


Check the other WSGI directives for the path definition, WSGIDaemonProcess is one of them that will have its own path definition, if this is so try setting it there.

permanent link

answered 24 May '12, 17:21

johns
5.4k312
accept rate: 23%

This has it's path set to the local install of Python2.7 - I assumed this was required?

(25 May '12, 01:26) richbeales

It is required, You can add a semicolon to add more than 1 path to this setting, try adding the application path.

(25 May '12, 01:33) johns
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
×44
×4

question asked: 24 May '12, 14:59

question was seen: 3,793 times

last updated: 25 May '12, 01:33

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