There is indeed a better way: Structured Settings.
Turn the usual pattern of having settings.py import local_settings.py
upside down. Call your specific setting (you can specify it be altering
the DJANGO_SETTINGS_MODULE environment variable in your virtualenv
activation script) and it will im
On 19/09/2013 3:59pm, Victor Hooi wrote:
Hi,
Hmm, in many cases there isn't really a sensible default (e.g. API keys
or passwords).
I was asking more in terms of - is this the "right" way of doing it in
Django, or are people using some other technique to handle configuration
you don't want in t
Hi,
Hmm, in many cases there isn't really a sensible default (e.g. API keys or
passwords).
I was asking more in terms of - is this the "right" way of doing it in
Django, or are people using some other technique to handle configuration
you don't want in the repo?
And is there a special excepti
Hi,
Do you means some thing like this?
os.environ.get('SOME_VARIABLE', 'default_value')
Regards,
Dig
On Sep 19, 2013 1:37 PM, "Victor Hooi" wrote:
> Hi,
>
> I have several settings in my Django settings.py file that are specific
>
> Currently, I'm grabbing these from environment variables in
Hi,
I have several settings in my Django settings.py file that are specific
Currently, I'm grabbing these from environment variables in settings.py:
import os
> ...
> # TODO - We need to gracefully catch if these aren't set.
> SOME_VARIABLE = os.environ['SOME_VARIABLE']
This includes things l
5 matches
Mail list logo