The other benefit of what limodou proposes is that is makes it really easy to generate another
secret key when it is required.

for example I've got 4-5 sites using basically the same settings file. when I want to create another
I usually just copy the settings file, and alter the cookie name and secret key. having a simple way to
generate the random string would be nice (right now I just generate a seperate project, grab it's random key and RM
the other stuff)

FWIW I stole the idea of Hugo ;-)

regards
Ian.

On 06/08/2006, at 12:21 PM, Adrian Holovaty wrote:


On 8/5/06, limodou <[EMAIL PROTECTED]> wrote:
When you create a new project,  django-admin.py will create a
SECRET_KEY and saves it in settings.py. Sometimes we are developing an
open source project, so we'll bring settings.py to public also. And
also make SECRET_KEY openned. So I think if django-admin.py could
create a file(maybe .key or key) when creating the project, and change
the SECRET_KEY to:

SECRET_KEY = file('.key', 'rb').read()

I second what Malcolm said. Here's your solution:

    # settings.py
    from secretkey import SECRET_KEY

    # secretkey.py
    SECRET_KEY = 'foo'

Adrian

-- 
Adrian Holovaty
holovaty.com | djangoproject.com


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Django developers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/django-developers
-~----------~----~----~----~------~----~------~--~---

Reply via email to