Use Pydantic to enhance your Django application settings.
Project description
Django Base Settings
Use Pydantic to enhance your Django application settings.
Requirements
- Python 3.10 or newer
Installation
To install Django Base Settings, run the following command:
poetry add django-base-settings
Usage
In your Django settings file, define a subclass of DjangoBaseSettings
:
class MySiteSettings(DjangoBaseSettings):
allowed_hosts: list[str] = ["www.example.com"]
debug: bool = False
default_from_email: str = "webmaster@example.com"
my_site_settings = MySiteSettings()
This is equivalent to:
ALLOWED_HOSTS = ["www.example.com"]
DEBUG = False
DEFAULT_FROM_EMAIL = "webmaster@example.com"
Field names in DjangoBaseSettings
are case-insensitive and can be overridden through environment variables.
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Close
Hashes for django_base_settings-0.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 660bf9c8ae07b33cb463fbfb19f27b404e316a7975b36de87f208a92e019ca22 |
|
MD5 | c4fe452ebb425cdd5ad7820f86557d60 |
|
BLAKE2b-256 | 8857b12498cbaf80801eb694a89b00e3e50ef6b6693ac3bc7d34e88c5c766165 |
Close
Hashes for django_base_settings-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4082fb396d494508c78a2f4fe08ff39e37b81af10e6334cb1ce75a9a17e1be33 |
|
MD5 | fc5b10a8c09313b87f7f83e7355ae17f |
|
BLAKE2b-256 | 9466e9ac7d237d7483ed0742756ac716bd92260fd14a5a57a3b2e84a5fc841aa |