[patch] django-admin.py diffsettings: display differences between project settings and default settings
|Reported by:||pb@…||Owned by:||adrian|
|Component:||Core (Management commands)||Version:||magic-removal|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
Per Adrian's encouragement (http://groups.google.com/group/django-developers/msg/069f6ed196c7c771), here's some code that does a diff-like operation between the current project's settings.py and Django's default settings.
Example usage: manage.py diffsettings (also works with django-admin.py)
This produces a clean, sorted, comment-free list of the settings that diverge from the defaults. Settings with no corresponding default values are followed by '###'; it seemed like a good idea to highlight "new" settings (including user-created ones), but I also wanted the output of this command to be usable as a settings file -- in theory, you could clean up your settings file by replacing it with the output of this command.
It's modeled after Postfix's "postconf -n", which is often used on the Postfix mailing for troubleshooting.
If this isn't deemed useful, no problem, but I wanted to contribute it just in case. Suggestions for a better command name than "diffsettings" are especially welcome.
Change History (10)
Changed 8 years ago by pb@…
comment:2 Changed 8 years ago by pb@…
- Summary changed from [patch] Display differences between project settings and default settings to [patch] django-admin.py diffsettings: display differences between project settings and default settings
comment:5 Changed 8 years ago by Petar Marić <petar.maric@…>
- Resolution fixed deleted
- Status changed from closed to reopened