Tuesday, March 25, 2014

Re: Get secret key from django settings

Hi Errfan,
You can get the SECRET_KEY through the environment variables. Just use:

from os import environ
SECRET_KEY = environ.get('SECRET_KEY')

Good luck!


Shai.


On Tue, Mar 25, 2014 at 8:36 AM, Errfan Wadia <wadiairfan.02@gmail.com> wrote:
Hi,

I am using from django.conf import settings
Is there any faster way to get the SECRET_KEY in one of my app from settings.py ?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/255c4e5c-65ad-43bf-9be0-4760c35de785%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CALr%3D9OW7iYCgZa5i5bx7nioCnPYPK1bQ2hwkwEM5cKC6Nsk4tA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment