Skip to main content

App Settings for Django

Project description


For the latest source, discussions, bug reports, etc., please visit the GitHub repository

Django Pods

Django Pods is a minimalist package that lets you configure default settings for your reusable apps, and allows developers using your apps to override these defaults in their own project settings.

This package is largely inspired by Django Rest Framework and Django AllAuth and adapted to work with Django Applications, but also with any classes extending pods.apps.AppSettings.


Django Pods allows developers to customise app settings in two ways:

  1. Dictionary style (as per Django Rest Framework):

    YOUR_APP = {
        "SETTING": "VALUE"
  2. Prefix style:



pip install django-pods

Usage in Reusable Apps

  1. If you are publishing a packaged application, add django-pods to the install_requires of your

        install_requires=["django-pods", ...],
  2. Add the AppSettings mixin to your AppConfig implementation in rock_n_roll/

    from django.apps import AppConfig
    from pods.apps import AppSettings
    class RockNRollConfig(AppSettings, AppConfig):
        name = 'rock_n_roll'
        verbose_name = "Rock ’n’ roll"
        # Path to app settings module
        settings_module = "rock_n_roll.app_settings"
        # Optional
        settings_imports = ("CLASS_TO_IMPORT",)
        # Optional
        # defaults to the capitalized class name, e.g. ROCK_N_ROLL_CONFIG
        settings_key = "ROCK_N_ROLL"
  3. Declare your default app settings in rock_n_roll/

    QUESTION = "What is your favourite band?"
    ANSWER = "The Rolling Stones"
  4. Access your settings anywhere in your package:

    from django.apps import apps
    app = apps.get_app_config('rock_n_roll')
    # What is your favourite band?
    # The Rolling Stomes
    # <class ''>

Settings can also be accessed directly via the class:

from rock_n_roll.apps import RockNRollConfig



AppSettings ``settings`` Property

AppSettings implements __getattr__ to proxy to the settings attributes of the class:

app.QUESTION == app.settings.QUESTION

# or

RockNRollConfig.QUESTION == RockNRollConfig.settings.QUESTION


Usage with Django < 1.7

Prior to Django 1.7, there wasn’t a logical place to create a class representing an app. However, any class can extend AppSettings. For example, in

from pods.apps import AppSettings

class AnyClass(AppSettings):
    settings_module = "rock_n_roll.app_settings"

Import your app class directly:

from .models import AnyClass


Usage in Projects

  1. Install the app that uses Django Pods:

    pip install rock_n_roll
  2. Add the app to the INSTALLED_APPS of your project/

  3. Override the app’s settings as needed:

    # Dictionary style
    ROCK_N_ROLL = {
        "ANSWER": "The Beatles",
    # Prefix style
    ROCK_N_ROLL_ANSWER = "The Beatles"

Running Tests



All contributions and comments are welcome.

Project details

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
django_pods-1.1.4-py2.py3-none-any.whl (7.0 kB) Copy SHA256 hash SHA256 Wheel py2.py3

Supported by

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