Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#19428 closed Bug (worksforme)

Django 1.5b1 raises "The SECRET_KEY setting must not be empty." even if it is set in an imported file

Reported by: nick@… Owned by: nobody
Component: Uncategorized Version: 1.5-beta-1
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description

My SECRET_KEY lives in a file called settings_common.py that is imported on the first line of settings.py at the various stages of development using:

from settings_common import *

settings.py then contains DATABASES and DEBUG settings only. This worked fine in Django 1.4 however Django 1.5b1 is saying that SECRET_KEY is not set even though it is.

I have added

print self.SECRET_KEY

statements around the SECRET_KEY checker in django/conf/init.py and if the ImproperlyConfigured exception is commented out they display the key properly. However if the exception is allowed to raise, they appear blank.

Change History (2)

comment:1 by Carl Meyer, 12 years ago

Resolution: worksforme
Status: newclosed

Thanks for the report!

I can't reproduce this issue using the setup you describe (unless the SECRET_KEY value in the settings_common.py file is in fact the empty string, in which case the error is correct).

If you reopen, please attach a set of project files that cause the problem for you, preferably stripped down to the simplest case.

comment:2 by anonymous, 12 years ago

My apologies, turned out it was THUMBNAIL_PROCESSORS for easy_thumbnails' settings import that doesn't have SECRET_KEY set.

Thanks!

Note: See TracTickets for help on using tickets.
Back to Top