You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for a great utility. It's kept my Django settings sane for a few years now.
I manage several large Django projects with many apps that are deployed in multiple settings, each time having a different INSTALLED_APP stack. A pattern I've found immensely useful in this scenario is for my constituent app packages to include default settings files as packaged resources. I give them alternate extensions (i.e. .conf instead of .py) so my system knows which ones to automagically include.
I've been using an extended version of django-split-settings to accomplish this, but I think others could find this useful as well so I'm happy to submit my extensions as a PR.
For example, the idea is to be able to include packaged resources where your directory structure looks like:
fromsplit_settingsimportinclude, resource, optionalfrommypackageimportsettingsinclude(
resource(settings, 'base.conf'),
resource('mypackage.settings', 'base.conf'), # alternateoptional(resource(settings, 'local.conf')), # optional can wrap resources too
)
Another nicety about using an alternate to .py for your settings files is that its a visual cue to other devs (and your IDE) that these files may not behave like typical python files on account of how split-settings sets their scope.
The text was updated successfully, but these errors were encountered:
Thanks for a great utility. It's kept my Django settings sane for a few years now.
I manage several large Django projects with many apps that are deployed in multiple settings, each time having a different INSTALLED_APP stack. A pattern I've found immensely useful in this scenario is for my constituent app packages to include default settings files as packaged resources. I give them alternate extensions (i.e. .conf instead of .py) so my system knows which ones to automagically include.
I've been using an extended version of django-split-settings to accomplish this, but I think others could find this useful as well so I'm happy to submit my extensions as a PR.
For example, the idea is to be able to include packaged resources where your directory structure looks like:
As so:
Another nicety about using an alternate to .py for your settings files is that its a visual cue to other devs (and your IDE) that these files may not behave like typical python files on account of how split-settings sets their scope.
The text was updated successfully, but these errors were encountered: