WebFaction
Community site: login faq

I've edited the /apache2/bin/start script and added on the first line:

export DJANGO_SETTINGS_MODULE=myproject.settings.prod

it does work.

should I do the same for the apache/bin/restart script?

And is that the correct way of doing it?

I've tried using SetEnv in the httpd.conf file, but no success.

asked 05 Nov '16, 19:50

clip
138
accept rate: 0%


Yes, that's correct.

In general, you can set any environment variables you need in the "start" script (the restart script calls the start script, so you don't need to set it there as well). This also works for PATH, LD_LIBRARY_PATH, and similar.

Another advantage of setting variables in the start script is that they're set if your application is started by cron instead of manually through the shell.

Hope that helps!

permanent link

answered 06 Nov '16, 02:13

ryans ♦♦
5.0k93160
accept rate: 43%

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:

×906
×224
×16
×5

question asked: 05 Nov '16, 19:50

question was seen: 1,356 times

last updated: 06 Nov '16, 02:13

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