A Django package to validate environment variables given a schema of rules.
Project description
Project Description
Django env validator is a package used to validate the .env file in a Django project using a set schema of rules.
Installation
The package can be installed and used in your Django app with pip:
pip install django-env-validator
Edit your settings.py file to include ‘django_env_validator’ in the INSTALLED_APPS listing.
INSTALLED_APPS = [
...
'django_env_validator',
]
Usage
Define the variable ENV_VALIDATOR_RULES in your settings.py
The current available rules are:
- required (boolean -- is the environment variable a required one or not)
- min_length (integer -- minimum character length of the environment variable)
- max_length (integer -- maximum character length of the environment variable)
- choices (list, tuple, set -- specific values the environment variable can be)
Example:
ENV_VALIDATOR_RULES = {
"API_KEY": {
"required": True,
"min_length": 15,
"max_length": 50,
},
"CURRENT_ENVIRONMENT": {
"required": True,
"choices": ["dev", "staging", "testing", "production"],
}
}
Project details
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file django_env_validator-1.0.1.tar.gz.
File metadata
- Download URL: django_env_validator-1.0.1.tar.gz
- Upload date:
- Size: 3.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b757d3302714a6ab2afa99fa59adf3090329ef8ad0419514217e8e4804803984
|
|
| MD5 |
500e895422efbe279025290fa13acc89
|
|
| BLAKE2b-256 |
69120d9f7d12e89065fbcce970c780769c5a01e7edcbb8c4ea32cfb5dabec209
|
Provenance
The following attestation bundles were made for django_env_validator-1.0.1.tar.gz:
Publisher:
publish.yml on 72mins/django-env-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_env_validator-1.0.1.tar.gz -
Subject digest:
b757d3302714a6ab2afa99fa59adf3090329ef8ad0419514217e8e4804803984 - Sigstore transparency entry: 163947486
- Sigstore integration time:
-
Permalink:
72mins/django-env-validator@85663da5d005c509ef69b1589886279bd9d1c986 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/72mins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85663da5d005c509ef69b1589886279bd9d1c986 -
Trigger Event:
release
-
Statement type:
File details
Details for the file django_env_validator-1.0.1-py3-none-any.whl.
File metadata
- Download URL: django_env_validator-1.0.1-py3-none-any.whl
- Upload date:
- Size: 4.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
50867c515ab6df8c297eb0888e26741d962214911b8d5e0b57aefcb5e61ddaa8
|
|
| MD5 |
17d3e13b81cdad4c9a1b98a686b2d6c9
|
|
| BLAKE2b-256 |
48532792790566b7193602b24dfe9c74c68188af580d2d2cd07a1f3c818852d8
|
Provenance
The following attestation bundles were made for django_env_validator-1.0.1-py3-none-any.whl:
Publisher:
publish.yml on 72mins/django-env-validator
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
django_env_validator-1.0.1-py3-none-any.whl -
Subject digest:
50867c515ab6df8c297eb0888e26741d962214911b8d5e0b57aefcb5e61ddaa8 - Sigstore transparency entry: 163947487
- Sigstore integration time:
-
Permalink:
72mins/django-env-validator@85663da5d005c509ef69b1589886279bd9d1c986 -
Branch / Tag:
refs/tags/v1.0.1 - Owner: https://github.com/72mins
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@85663da5d005c509ef69b1589886279bd9d1c986 -
Trigger Event:
release
-
Statement type: