Skip to main content

Effortless class-based settings for Django.

Project description


pypi django versions python build coverage license code style

django-class-settings aims to simplify complicated settings layouts by using classes instead of modules. Some of the benefits of using classes include:


# .env
export DJANGO_SECRET_KEY='*2#fz@c0w5fe8f-'
export DJANGO_DEBUG=true
import os
import sys

import class_settings
from class_settings import env

from import execute_from_command_line

if __name__ == '__main__':
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'myproject.settings')
    os.environ.setdefault('DJANGO_SETTINGS_CLASS', 'MySettings')
# myproject/
from class_settings import Settings, env

class MySettings(Settings):
    SECRET_KEY = env()
    DEBUG = env.bool(default=False)
    ROOT_URLCONF = 'myproject.urls'
    WSGI_APPLICATION = 'myproject.wsgi.application'


Install it from PyPI with pip:

pip install django-class-settings


  • Django 1.11+
  • Python 3.5+


Project details

Download files

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

Files for django-class-settings, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size django_class_settings-0.2.0-py3-none-any.whl (9.7 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size django-class-settings-0.2.0.tar.gz (9.3 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page