https://github.com/nigma/django-common-configs
Convention over configuration. Common settings for Django projects.
https://github.com/nigma/django-common-configs
Last synced: about 1 year ago
JSON representation
Convention over configuration. Common settings for Django projects.
- Host: GitHub
- URL: https://github.com/nigma/django-common-configs
- Owner: nigma
- License: bsd-3-clause
- Created: 2014-01-17T22:12:16.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2014-01-23T15:51:55.000Z (over 12 years ago)
- Last Synced: 2025-03-18T05:43:56.886Z (over 1 year ago)
- Language: Python
- Size: 180 KB
- Stars: 10
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.rst
- Changelog: HISTORY.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE
Awesome Lists containing this project
README
=====================
django-common-configs
=====================
.. image:: https://badge.fury.io/py/django-common-configs.png
:target: http://badge.fury.io/py/django-common-configs
.. image:: https://pypip.in/d/django-common-configs/badge.png
:target: https://crate.io/packages/django-common-configs?version=latest
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:
.. code-block:: py
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:
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.
Other Resources
---------------
- GitHub repository - https://github.com/nigma/django-common-configs
- PyPi Package site - http://pypi.python.org/pypi/django-common-configs