matthewwithanm/django-classbasedsettings — pull request #12 by jezdez (2012-06-16 23:01:00+00:00)
Title: Allow using the dynamically created module easier from code

It bothered me that the dynamically created module would have this odd unrolled name in it and wanted to also allow importing the setting class instance from real code.

E.g. currently runserver shows

Django version 1.4, using settings 'acme.settings_Production_unrolledcbsettings'

But it shouldn't be hard to guess the path of the class based setting. That's why this patch would instead prints

Django version 1.4, using settings 'acme.settings.production'

Code in Django that uses `import_module` to load the `SETTINGS_MODULE` will continue working, as it will use `acme.settings.production` as a module path and user code can use the import system on their own by importing the settings object directly with `from acme.settings import production`.

What do you think?