[patch] django-admin.py diffsettings: display differences between project settings and default settings
|Reported by:||Owned by:||Adrian Holovaty|
|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)
comment:2 Changed 11 years ago by
|Summary:||[patch] Display differences between project settings and default settings → [patch] django-admin.py diffsettings: display differences between project settings and default settings|