Skip to main content

Django Carpet 0.4.5

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 are normal, test, and e2e (accessed through EnvChoices)
  • is_debug -> Checks the DEBUG constant in settings.py
  • is_production -> Checks if the application is in the production mode. For the application to be in production mode, the DEBUG has to be false and exec_mode should be normal
  • is_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. The DEBUG 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 are test 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"

Release files for django-carpet 0.4.5

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-carpet 0.4.5
File Size Uploaded
django_carpet-0.4.5.tar.gz 16.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for django-carpet 0.4.5
File Interpreter ABI Platform
django_carpet-0.4.5-py3-none-any.whl Python 3 none any Details

Total release size: 34.9 kB

Release files / django_carpet-0.4.5.tar.gz

Download URL django_carpet-0.4.5.tar.gz
Size 16.4 kB
Tags Source
SHA-256 checksum
How to use checksums
1aacc729e62e517119779432c1ed1654ac92ede468f43d3d7409560741a82d6e
BLAKE2b-256 checksum
How to use checksums
33ef497a74ac94ded11073e04ad31be64f9ef3f1ae873537e88470bbf6122680
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release files / django_carpet-0.4.5-py3-none-any.whl

Download URL django_carpet-0.4.5-py3-none-any.whl
Size 18.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
0bb42bab74f03c5b4d74902e59becfe5e60fef1b2470702b665e0099a2194fc1
BLAKE2b-256 checksum
How to use checksums
ee3f15f0939a309f5e8ba41a2941b98ba50dd7ceb9e5e2d5711a6442bfb08cdd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.23

Release history Release notifications | RSS feed

This release

0.4.5 This release

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.14

2 release files

0.1.13

2 release files

0.1.12

2 release files

0.1.11

2 release files

0.1.10

2 release files

0.1.9

2 release files

0.1.8

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.2

2 release files

0.1.1

2 release files

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