WebFaction
Community site: login 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:

$ 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 09 Sep '12, 10:04

ldiqual
312
accept rate: 0%


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.

permanent link

answered 09 Sep '12, 10:19

todork
1.2k4
accept rate: 34%

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 !

(09 Sep '12, 13:54) ldiqual
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
×225
×55

question asked: 09 Sep '12, 10:04

question was seen: 2,906 times

last updated: 09 Sep '12, 13:54

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