Skip to main content
Help us improve Python packaging – donate today!

django12factor: Bringing 12factor to Django

Project Description

What is it?

Django is an awesome Python web framework.

The Twelve-Factor App” is an awesome methodology for building SaaS apps.

django-12factor makes Django more 12factor-y. Right now, this focuses on the Config - “Store config in the environment”; Heroku users with addons will be particularly familiar with this.

Usage

Add the following to the bottom of your settings.py:

import django12factor
d12f = django12factor.factorise()

factorise() returns a dict of settings, so you can now use and assign them as you wish, e.g.

DEBUG = d12f['DEBUG']
LOGGING = d12f['LOGGING']

If you don’t like that repetition, you can (ab)use globals() like so:

import django12factor
d12f = django12factor.factorise()

def f(setting):
    globals()[setting] = d12f[setting]

f('DEBUG')
f('LOGGING')

Give me everything!

If you say so…

import django12factor
globals().update(django12factor.factorise())

Settings

The following settings are currently supported:

DEBUG

TEMPLATE_DEBUG

CACHES

Uses `django-cache-url <https://github.com/ghickman/django-cache-url>`__

LOGGING

DATABASES

Uses `dj-database-url <https://github.com/kennethreitz/dj-database-url>`__

ALLOWED_HOSTS

SECRET_KEY

Release history Release notifications

History Node

1.3

History Node

1.2

History Node

1.1

This version
History Node

1.0

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
django12factor-1.0.tar.gz (2.7 kB) Copy SHA256 hash SHA256 Source None Apr 2, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page