Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

65 lines (42 sloc) 2.609 kB
= Django Configuration Generator =
Generates configuration files for Apache, Nginx, etc. using values in and the Django template system. You can write your own templates for whatever text based config file you need.
== Install ==
1. Install package via your preferred Python package manager (pip, setuptools, etc.).
2. Add 'django_config_gen' to your INSTALLED_APPS.
== Usage ==
Run './ config_gen' on the command line in your project directory.
Templates for your config files go in:
All text files in that directory are loaded with the Django template system using values from as Context. The output of each file is saved with the same filename but in the following directory:
These output directories can be customized using CONFIG_GEN_TEMPLATES_DIR and CONFIG_GEN_GENERATED_DIR in
Example templates are provided in 'django-config-gen/django_config_gen/management/commands/example_templates'. If the folder specified by CONFIG_GEN_TEMPLATES_DIR is empty then these will be copied there and used for generating templates.
= Default Variables =
Some default variables are used in the Context used to render the config files, and they can be manually overridden in
The absolute path to the directory your is in.
A directory called 'logs/' within your PROJECT_ROOT.
A directory called 'config/templates/' in your PROJECT_ROOT.
A directory called 'config/generated/' in your PROJECT_ROOT.
A list of custom context processors that are to be used when rendering config files. Example:
def foo(*args, **kwargs):
return {'foo': 'bar'}
Nothing is currently passed in to the context processors but that may change in the future, so using *args and **kwargs in the method signature will help ensure forward compatibility.
The hostname specified in your database for the current Site. If "./ syncdb" hasn't been run yet, the value 'localhost' is used.
= Contributing =
You can fork this project on GitHub:
= License =
This project is licensed under the BSD License.
== Links ==
Jump to Line
Something went wrong with that request. Please try again.