Skip to main content

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

Project details


Download files

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

Source Distribution

django12factor-0.1.tar.gz (2.7 kB view details)

Uploaded Source

File details

Details for the file django12factor-0.1.tar.gz.

File metadata

  • Download URL: django12factor-0.1.tar.gz
  • Upload date:
  • Size: 2.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for django12factor-0.1.tar.gz
Algorithm Hash digest
SHA256 542c0bcf2f361c304e46791d7a6fae71b9ee437581f99995230a1382d5442037
MD5 0649d7ed9104ee3bececd31ec69be31c
BLAKE2b-256 02790ec38bd233fdcb45628238e8fb672ad48bfa93117319de159c18c58b2548

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page