#29324: Change Settings to raise ImproperlyConfigured on SECRET_KEY; not
initialization
------------------------------------------------+------------------------
Reporter: Jon Dufresne | Owner: nobody
Type: Cleanup/optimization | Status: new
Component: Core (Other) | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+------------------------
Since ticket #17800, initializing settings without a `SECRET_KEY` raises a
an `ImproperlyConfigured` during settings initialization.
Instead, I think the error should be raised when the setting is
''accessed'' as `Settings.SECRET_KEY`.
My use case, my project has a number of management commands that run in a
non-production, minimally configured environment. These management
commands do not require `SECRET_KEY`, however, the environment is forced
to provide one.
As a workaround this environment has been generating a random secret key
each run. If Django were to instead raise the error on `SECRET_KEY`
access, this workaround would not be necessary.
--
Ticket URL: <https://code.djangoproject.com/ticket/29324>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" 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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/052.9de057e22ae9f3ae02ccb551194776cd%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.