Foundational functionalities for Django
Project description
Django Carpet 0.2.0
This package contains the base function and classes for a Django project
The project has the following sections:
- env
- exceptions
- mixins
- paginate
- response
- validators
- xml_element
Note: This package requires python 3.11 and higher
Installation
pip install django-carpet
ENV
The env
checks the execution mode and deployment status of the application and contains the following functions:
exec_mode
-> Gets the execution mode of the application. The options arenormal
,test
, ande2e
(accessed throughEnvChoices
)is_debug
-> Checks theDEBUG
constant insettings.py
is_production
-> Checks if the application is in the production mode. For the application to be in production mode, theDEBUG
has to be false andexec_mode
should be normalis_testing
-> Checks if the application is in unit test or e2e test
In order for these functions to behave as intended, you need 3 settings to differentiate between the three execution modes. The execution mode is determined using EXEC_MODE
constant. If no such constant is provided, the default value is normal
. The name of the files is up to you:
settings.py
: The settings for the production. TheDEBUG
must be set to false.settings_dev.py
: The settings for the development mode. This setting sets the DEBUG to false and detects if we aretest
command. It should have the following:
DEBUG = True
if 'test' in sys.argv:
EXEC_MODE = "test"
settings_e2e.py
: The settings for the E2E tests, allowing you to differentiate between the E2E tests and normal dev server. It should contain the following:
DEBUG = True
EXEC_MODE = "e2e"
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
File details
Details for the file django_carpet-0.2.0.tar.gz
.
File metadata
- Download URL: django_carpet-0.2.0.tar.gz
- Upload date:
- Size: 15.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c778f46684b1f7c16a57c8014f15c26e499f8605be5f43dd69e5d784f306ed31 |
|
MD5 | 75bb2af09f93d3f63b8c37f105373cab |
|
BLAKE2b-256 | d04b398603aca92e80819302db4ddefcdc71a4d7e39e5e35e5197917c510dd9e |
File details
Details for the file django_carpet-0.2.0-py3-none-any.whl
.
File metadata
- Download URL: django_carpet-0.2.0-py3-none-any.whl
- Upload date:
- Size: 18.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b6b3a1b2896214dc23427099b64ed8658c6915f1cfe2cc1e17b96e1932a27d6c |
|
MD5 | a4449059e93d19bbfd8ede3aaf243961 |
|
BLAKE2b-256 | 8a3cf94d078a3b90e377b21c4edfa8a08101057e22effa2ff637a4b6b5247746 |