Skip to main content
=================
django-config-gen
=================

.. image:: https://travis-ci.org/greyside/django-config-gen.svg
:target: https://travis-ci.org/greyside/django-config-gen
:alt: CI

.. image:: https://coveralls.io/repos/greyside/django-config-gen/badge.svg?service=github
:target: https://coveralls.io/github/greyside/django-config-gen
:alt: Code Coverage

.. image:: https://img.shields.io/pypi/v/django-tastypie.svg
:target: https://pypi.python.org/pypi/django-tastypie
:alt: Version

.. image:: https://img.shields.io/pypi/dm/django-tastypie.svg
:target: https://pypi.python.org/pypi/django-tastypie
:alt: Downloads

Generates configuration files for Apache, Nginx, etc. using values in
settings.py and the Django template system. You can write your own templates
for whatever text based config file you need.

Install
=======

Requires:
---------

* Python 2.7+ or Python 3.4+
* Django 1.7 through Django 1.9

1. `pip install django-config-gen`

2. Add 'django_config_gen' to your `INSTALLED_APPS`.

Usage
=====

Run './manage.py config_gen' on the command line in your project directory.

Templates for your config files go in:
<project_path>/config/templates/

All text files in that directory are loaded with the Django template system
using values from settings.py as Context. The output of each file is saved with
the same filename but in the following directory:
<project_path>/config/generated/

These output directories can be customized using CONFIG_GEN_TEMPLATES_DIR and CONFIG_GEN_GENERATED_DIR in settings.py.

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 settings.py.

PROJECT_ROOT
The absolute path to the directory your manage.py is in.

LOG_DIR
A directory called 'logs/' within your PROJECT_ROOT.

CONFIG_GEN_TEMPLATES_DIR
A directory called 'config/templates/' in your PROJECT_ROOT.

CONFIG_GEN_GENERATED_DIR
A directory called 'config/generated/' in your PROJECT_ROOT.

CONFIG_GEN_CONTEXT_PROCESSORS
A list of custom context processors that are to be used when rendering config
files. Example:

settings.py:

.. code:: python

CONFIG_GEN_CONTEXT_PROCESSORS = ['myapp.config_context_processors.foo']

myapp/config_context_processors.py:

.. code:: python

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.

HOST
The hostname specified in your database for the current Site. If
`./manage.py syncdb` hasn't been run yet, the value 'localhost' is used.

Contributing
============

You can fork this project on GitHub: http://github.com/greyside/django-config-gen.

License
=======

This project is licensed under the BSD License.
http://www.opensource.org/licenses/bsd-license.php

Links
=====

https://github.com/greyside/django-config-gen
http://pypi.python.org/pypi/django-config-gen
http://djangopackages.com/packages/p/django-config-gen/

Metadata

Release files for django-config-gen 1.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-config-gen 1.1.0
File Size Uploaded Provenance
django-config-gen-1.1.0.tar.gz 10.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for django-config-gen 1.1.0
File Interpreter ABI Platform
django_config_gen-1.1.0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 21.9 kB

Release files / django-config-gen-1.1.0.tar.gz

Download URL django-config-gen-1.1.0.tar.gz
Size 10.3 kB
Tags Source
SHA-256 checksum
How to use checksums
8bce2cb96b2dc86addc6b1b721a2775ba08704030527d758356043579e10af25
BLAKE2b-256 checksum
How to use checksums
6b443a650892a99e80e62a83a4bee8adf132eef14f018dc3a8cd9e5f327540f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_config_gen-1.1.0-py2.py3-none-any.whl

Download URL django_config_gen-1.1.0-py2.py3-none-any.whl
Size 11.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
33889f0b63d336b5fdd94de7c07947964b189fc546dd626d41e5f68d6c766e14
BLAKE2b-256 checksum
How to use checksums
f6d3974650e8252f8e2a1a635d1a18e72ac192cf911b7e36265f5e08a9462ad5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-config-gen 1.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page