login community faq

I have a django website running with PIP and a virtual environment. To launch apache, I just navigate to my django app folder, and:

1
2
$ source ./venv/bin/activate
$ ../apache2/bin/restart

As I start apache from my shell, it is aware of the current environment (which is my app virtualenv).

However, for some reason, apache get restarted (I guess by a cron job or something) and then doesn't know about my app's virtual environment). I get 500 errors over and over because of python imports.

What does restart my apache instance and why ? How to make it aware of my virtual environment each time it starts ?

asked Sep 09 '12 at 10:04

ldiqual's gravatar image

ldiqual
31


Hi,

There are various reasons why your Apache server may be restarted. For example, your processes might be getting killed for memory overusage. To check this see the Messages section in your control panel.

You can activate the virtual environment within your WSGI script. You can also check mod_wsgi's docs on using virtualenvs.

If you run into any troubles, please open a ticket, so we can take a look.

answered Sep 09 '12 at 10:19

todork's gravatar image

todork
10964

I have no messages in my webfaction mailbox, so I don't think it's memory issue. I put site.addsitedir('/path/to/venv/') in my wsgi.py, I'll let you know if there is a problem again. Thank you for your help !

(Sep 09 '12 at 13:54) ldiqual ldiqual's gravatar image
Your answer
If you have an answer to the above question, then use the form below. Otherwise, use the appropriate 'add new comment' button above to post your feedback.
toggle preview

Plans & prices    Sign up    Why WebFaction?    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
Powered by OSQA
© Copyright 2003-2012 Swarma Limited - WebFaction is a service of Swarma Limited