You can use both.
If you put exports in your .bashrc you will have it for all your terminal
session. When you run a bash script to load uwsgi from supervisor as
example, you need to load this .bashrc with source.

It's same as use a command line like:

SOMEAPP_DB_USER="someapp" SOMEAPP_DB_PASSWORD="1234"
<path_to_venv>/bin/uwsgi *args

or to run celery

SOMEAPP_DB_USER="someapp" SOMEAPP_DB_PASSWORD="1234"
<path_to_venv>/bin/python <path_to_your_project>/manage.py celery worker

I like more idea of load a file from settings:
exec("/home/<user>/.<appname>_secrets", globals())

This .<appname>_secrets will have SECRET_KEY, db connection, etc.

Did you read https://code.djangoproject.com/wiki/SplitSettings ?

Felipe 'chronos' Prenholato.
Linux User nÂș 405489
Home page: http://devwithpassion.com | http://chronosbox.org/blog
GitHub: http://github.com/chronossc/ | Twitter: http://twitter.com/chronossc


2013/3/21 demet8 <[email protected]>

> I have a common.py, dev.py, and prod.py for my Django settings files. All
> files inherit from common.py. I want to keep my database passwords,
> database URL, etc stored as environment variables. I have researched the
> topic but I am not sure If I have a clear understanding of it. I am hoping
> I can get a more comprehensive answer via this forum. This is what I have
> thus far:
>
>
> *In your bash shell type:*
>
> export SOMEAPP_DB_USER='someapp'
> export SOMEAPP_DB_PASSWORD='1234'
>
> *In my Django settings file type*:
>
> DATABASE_USER = os.environ.get("SOMEAPP_DB_USER", ")
> DATABASE_PASSWORD = os.environ.get("SOMEAPP_DB_PASSWORD", ")
>
> So are my passwords stored in just a terminal session? or are they being
> stored in something like my bash_profile?
>
> Thanks.
>
>  --
> You received this message because you are subscribed to the Google Groups
> "Django developers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To post to this group, send email to [email protected].
> Visit this group at http://groups.google.com/group/django-developers?hl=en
> .
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/django-developers?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to