We’re happy to announce the first beta release of django-pastedeploy-settings, a more maintainable way to define and override Django settings. Its features include:
- Simple, Python-free configuration files. The format used is INI because configuration files should be declarative, not scripts.
- Settings can be inherited. For example, you can define your base settings in your project’s repository, while overriding some from a separate file outside your repository.
- Setting values are defined with JSON.
- Variable substitution, allowing you to define a value once and reuse it in different settings.
- Integration with Buildout, so that you can expose your Django settings to Buildout parts.
- Integration with Nose, so that you can easily set the settings to be used by your test suites.Under the hood, this library uses Paste Deployment, a widely-used system which has the sole purpose of enabling developers and sysadmins to configure WSGI applications (like Django) and WSGI servers.
In spite of this being the first public release of this library, its code is based on twod.wsgi v1, a library which we’ve been maintaining and using in production for over 3 years.
Example
You can keep the following file in your project’s repository:
And then have two separate files, one for development and the other for production, both of which will extend base.ini:
Alternatively, you can keep it all in one file:
Get it while it’s hot!