Skip to main content
django-defaults
===

Django settings sans boilerplate

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

Installation
---

```sh
pip install -U django django-defaults
```

Usage
---

**Updating an existing Django project**

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

```toml
[django]
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 `settings.py`)

```python
from defaults import emplace

emplace()
```

This replaces the entirety of the stock `settings.py` 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 `manage.py`)

```python
from defaults import setenv

setenv()
```

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

**Creating a new Django project**

```sh
URL=https://github.com/mvasilkov/django-defaults/archive/template.zip
django-admin startproject --template $URL --extension py,toml PROJECT_NAME
```

See the [project template][1]

[1]: https://github.com/mvasilkov/django-defaults/tree/template
[2]: https://github.com/mvasilkov/django-defaults
[3]: https://pypi.org/project/django-defaults/

Metadata

Release files for django-defaults 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-defaults 0.0.1
File Size Uploaded Provenance Actions
django-defaults-0.0.1.tar.gz 4.0 kB Without provenance Details for django-defaults-0.0.1.tar.gz

Release files / django-defaults-0.0.1.tar.gz

Download URL django-defaults-0.0.1.tar.gz
Size 4.0 kB
Tags Source
SHA-256 checksum
How to use checksums
a286282fb00b4ea81fc4ff8f2569605d815a8fbfd4939359a8925786273622e8
BLAKE2b-256 checksum
How to use checksums
98a2f6ee015fee61f18ac5cc313ad6cf49aa6f58f0d80ff70f0238768a9d8b56
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-defaults 0.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page