Skip to main content

Foundational functionalities for Django

Project description

Django Carpet 0.4.2

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"

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

django_carpet-0.4.2.tar.gz (16.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

django_carpet-0.4.2-py3-none-any.whl (18.3 kB view details)

Uploaded Python 3

File details

Details for the file django_carpet-0.4.2.tar.gz.

File metadata

  • Download URL: django_carpet-0.4.2.tar.gz
  • Upload date:
  • Size: 16.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for django_carpet-0.4.2.tar.gz
Algorithm Hash digest
SHA256 b65a3d3c9fa02bde74533b4116fa6df84afa763f03f41e81f85ba3ff93687385
MD5 4fb791e166f9a9533b5ea57d7f5eb685
BLAKE2b-256 8bd2e1157fcb84b5637d61fe5af0d75c77488d9210a2bbe235c28c9427b65f61

See more details on using hashes here.

File details

Details for the file django_carpet-0.4.2-py3-none-any.whl.

File metadata

  • Download URL: django_carpet-0.4.2-py3-none-any.whl
  • Upload date:
  • Size: 18.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.9.21

File hashes

Hashes for django_carpet-0.4.2-py3-none-any.whl
Algorithm Hash digest
SHA256 eba6ee2459cb2dc93cdadf622d0516200e32baf9ea4b1442ab12f86c6403713c
MD5 3d5ff6b0601c52988b8d46aab92c00c7
BLAKE2b-256 5daccf1a7abb9b995a4bad1e17ba56a4d81a51a0c1bcb3cfc4b0164e69383def

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page