WebFaction
Community site: login faq

I want to set some environment variables so that I could use them in the apps run on server. Normally I would add some content to /etc/profile, but this is impossible on webfaction due to permission issue. ~/.bash_profile won't work I suppose since it has nothing to do with shell.

So how could I do this? Thank you!( I found a similiar question, is this the solution?https://community.webfaction.com/questions/13711/handling-environment-variables-with-multiple-django-instances)

asked 23 Feb '14, 07:23

laike9m
29515
accept rate: 0%


You can set them inside your application's start script (/home/username/webapps/djangoapp/apache2/bin/start), on the same line as the start command:

MYVAR='my value' ... start

You should already see LD_LIBRARY_PATH being set this way. You can also do this inside wsgi.py:

os.environ['MYVAR'] = 'my value'

permanent link

answered 23 Feb '14, 19:39

yulian
27214
accept rate: 24%

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:

×14
×11

question asked: 23 Feb '14, 07:23

question was seen: 3,223 times

last updated: 23 Feb '14, 19:39

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