Bases: django.core.management.base.BaseCommand
Generate a diff between self.local_settings and the example file.
Patch local_settings.py.example with local_settings.diff.
The patch application generates the local_settings.py file (the local_settings.py.example remains unchanged).
http://github.com/sitkatech/pypatch fails if the local_settings.py.example file is not 100% identical to the one used to generate the first diff so we use the patch command instead.
Bases: object
Change directory in a context manager.
This allows changing directory and to always fall back to the previous directory whatever happens during execution.
Usage:
with DirContext('/home/foo') as dircontext:
# Some code happening in '/home/foo'
# We are back to the previous directory.
Gets the module path without importing anything.
Avoids conflicts with package dependencies. (taken from http://github.com/sitkatech/pypatch)