[GH-ISSUE #106] handling settings #102

Closed
opened 2026-02-26 09:35:39 +03:00 by kerem · 4 comments
Owner

Originally created by @ThomasWaldmann on GitHub (Dec 8, 2013).
Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/106

Originally assigned to: @ThomasWaldmann on GitHub.

how we currently deal with (django) settings(.py) seems a bit backwards, see there:

https://github.com/nsupdate-info/nsupdate.info/blob/master/nsupdate/settings.py

the way it currently is causes issues. e.g. today I was bitten by django-debug-toolbar relying on a setting defined in django's default settings, but it was not defined in nsupdate.settings. it was the reason that ddt just did not work, nor give an error msg. it started working after I added the setting to nsupdate.settings.

i think it should be like this:

nsupdate.settings:
from django.conf.global_settings import *
(override / add whatever we need)
(no .local_settings import at the end)

local_settings (which is located outside the repo!):
from nsupdate.settings import *
(override / add whatever we need locally)

Originally created by @ThomasWaldmann on GitHub (Dec 8, 2013). Original GitHub issue: https://github.com/nsupdate-info/nsupdate.info/issues/106 Originally assigned to: @ThomasWaldmann on GitHub. how we currently deal with (django) settings(.py) seems a bit backwards, see there: https://github.com/nsupdate-info/nsupdate.info/blob/master/nsupdate/settings.py the way it currently is causes issues. e.g. today I was bitten by django-debug-toolbar relying on a setting defined in django's default settings, but it was not defined in nsupdate.settings. it was the reason that ddt just did not work, nor give an error msg. it started working after I added the setting to nsupdate.settings. i think it should be like this: nsupdate.settings: from django.conf.global_settings import * (override / add whatever we need) (no .local_settings import at the end) local_settings (which is located outside the repo!): from nsupdate.settings import * (override / add whatever we need locally)
kerem 2026-02-26 09:35:39 +03:00
Author
Owner

@ThomasWaldmann commented on GitHub (Dec 8, 2013):

additional ideas:

make settings a package with base.py, prod.py, dev.py

import stuff that needs to be locally modified via env var / from a json file

<!-- gh-comment-id:30083620 --> @ThomasWaldmann commented on GitHub (Dec 8, 2013): additional ideas: make settings a package with base.py, prod.py, dev.py import stuff that needs to be locally modified via env var / from a json file
Author
Owner

@ThomasWaldmann commented on GitHub (Dec 8, 2013):

important

django internally / implicitly reads its own defaults and then overwrites the settings read from there with whatever settings the application uses.

thus: no star import needed to have django's defaults present. we just need to import what we need in our settings.py (e.g. to modify).

<!-- gh-comment-id:30083889 --> @ThomasWaldmann commented on GitHub (Dec 8, 2013): # important django internally / implicitly reads its own defaults and then overwrites the settings read from there with whatever settings the application uses. thus: no star import needed to have django's defaults present. we just need to import what we need in our settings.py (e.g. to modify).
Author
Owner

@ThomasWaldmann commented on GitHub (Dec 12, 2013):

remove local_settings import and improved docs d17bdd8006

<!-- gh-comment-id:30378309 --> @ThomasWaldmann commented on GitHub (Dec 12, 2013): remove local_settings import and improved docs d17bdd800654388534570cc37d99dfd1c8e74eab
Author
Owner

@ThomasWaldmann commented on GitHub (Dec 14, 2013):

fixed by cae77f53c9

<!-- gh-comment-id:30558123 --> @ThomasWaldmann commented on GitHub (Dec 14, 2013): fixed by cae77f53c9f839ecf79e27c76b94a62c70697852
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nsupdate.info-nsupdate-info#102
No description provided.