Welcome to django-common-configs’s documentation!

django-common-configs

https://badge.fury.io/py/django-common-configs.png https://pypip.in/d/django-common-configs/badge.png

Common Configuration settings for Django projects.

Goes in line with 12 factor app and popular hosting platforms like Heroku.

Developed and used at en.ig.ma software shop.

Overview

Getting Django and popular apps settings right require time and a bit of experience.

This project provides predefined and verified configs for various aspects of Django apps, promotes convention over configuration and allows to keep settings.py file DRY.

It covers security, static files, assets compression, storage, AWS, celery, Sentry, logging, integration with common services, Heroku and more.

Developed at en.ig.ma software shop and used in multiple projects.

Documentation

The full documentation is at http://django-common-configs.rtfd.org.

Quickstart

Simplify Django project configuration in two easy steps:

Include django-common-configs and other related packages in your requirements.txt file.

Install django-configurations, add required common config mixins (they are just plain Python classes) to your settings.py Configuration classes and override base settings as necessary:

from common_configs import Configuration, values

from common_configs.django import Locale, SingleSite, DjangoSecurity
from common_configs.apps import CrispyForms, Imagekit, CeleryDev, CompressDev, CompressProd
from common_configs.logging import StructLoggingDev, StructLoggingProd
from common_configs.paas.heroku import Heroku, CeleryHerokuBigWig
from common_configs.services import APNS, GCM, CacheDev, AWS, Mailgun, Sendgrid, Raven, Pusher, Twilio
from common_configs.storage import LocalCompressStorage, AWSCompressStorage


class Common(Locale, SingleSite,
             CrispyForms, Imagekit, APNS, GCM,
             Configuration):

    DEBUG = False
    TEMPLATE_DEBUG = False


class DevConfig(LocalCompressStorage, CeleryDev, CompressDev, StructLoggingDev, CacheDev,
                Common):

    DEBUG = True
    TEMPLATE_DEBUG = True
    DATABASES = values.DatabaseURLValue("postgres://...")


class ProdConfig(AWS, AWSCompressStorage, CeleryHerokuBigWig, CompressProd, StructLoggingProd,
                 Heroku, Mailgun, Raven, Pusher, Twilio,
                 DjangoSecurity,
                 Common):
    pass

Dependencies

django-common-configs depends on django-configurations>=0.7 and optionally on the following packages:

Module Requirements
security django-secure>=1.0, django_csp>=2.0.3
compress django_compressor>=1.3
debug django-debug-toolbar>=1.0.1
auth django-allauth>=0.15.0
forms django-crispy-forms>=1.4.0
imagekit django-imagekit>=3.2
pusher pusher>=0.8
sentry raven>=4.0.3
storage boto>=2.23.0, django-storages>=1.1.8, Collectfast>=0.1.13
logging django-log-request-id>=0.0.3
structlog structlog>=0.4.1, django-log-request-id>=0.0.3
twilio twilio
heroku django-pylibmc-sasl>=0.2.4, django-heroku-memcacheify>=0.4, django-heroku-postgresify>=0.3

All dependencies can be easily added to your requirements.txt file by specifying it using pip syntax:

django-common-configs[security,compress,debug,auth,forms,imagekit,pusher,sentry,storage,structlog,twilio,heroku]==0.1.0

License

django-common-configs is released under the BSD license.

Indices and tables

Read the Docs v: latest
Versions
latest
Downloads
PDF
HTML
Epub
On Read the Docs
Project Home
Builds

Free document hosting provided by Read the Docs.