Skip to main content

Django settings sans boilerplate

Project description


Django settings sans boilerplate

[GitHub][2] ・ [PyPI][3]


pip install -U django django-defaults


**Updating an existing Django project**

1️⃣ Create a new file named `defaults.toml` (next to ``) with the following contents:

settings-module = 'PROJECT_NAME.settings'
routes-module = 'PROJECT_NAME.urls'

This is the compulsory configuration file.

* `settings-module` is similar to `DJANGO_SETTINGS_MODULE`
* `routes-module` is similar to `ROOT_URLCONF`

2️⃣ Inject configuration variables into the current module (typically in ``)

from defaults import emplace


This replaces the entirety of the stock `` file, as generated by the `django-admin startproject` command.

3️⃣ Optional: ensure that the `DJANGO_SETTINGS_MODULE` environment variable is set (in scripts such as ``)

from defaults import setenv


This replaces the `os.environ.setdefault(DJANGO_SETTINGS_MODULE)` line.

**Creating a new Django project**

django-admin startproject --template $URL --extension py,toml PROJECT_NAME

See the [project template][1]


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

django-defaults-0.0.1.tar.gz (4.0 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page