Skip to main content

django-app-requires

A simple Django app that allows you to specify app dependencies and middleware dependencies in your own apps, and also add defaults for additional configurations.

Install

pip install django-app-requires

Usage

your_app/__init__.py

app_requires = [
    "your",
    "required",
    "apps",
]

app_middleware_requires = [
    "your",
    "required",
    "middlewares",
]

# Django's setting key must be in upper case.
# default values will be overrided by items in pro/settings.py.

app_setting_defaults = {
    "HELLO": "WORLD",
}

app_setting_callbacks = {
    "your_app.setting_callbacks.callback1",
}

your_app/setting_callbacks.py

def callback1(globals):
    globals["EXTRA_ITEM"] = "EXTRA_VALUE"

pro/settings

INSTALLED_APPS = [
    ...
    'your_app',
    ...
]

#
# at the bottom of settings.py
#
from django_app_requires import patch_all
patch_all()

# so the final INSTALLED_APPS = [
#     "your",
#     "required",
#     "apps",
#     "your_app",
#     "django_app_requires",
# ]

# so the final MIDDLEWARE = [
#    ...
#    "your",
#    "required",
#    "middlewares",
#    ...
# ]

# so the final you got a new setting item:
# HELLO = "WORLD"

## so the final you got a new setting item which provided by callback1:
# EXTRA_ITEM = "EXTRA_VALUE"

Releases

v0.1.0

  • First release.

v0.1.1

  • Add fastutils & magic-import in requirements.txt.
  • Fix problems of recursive required.

v0.2.0

  • Add collect_requirements function. Removed

v0.2.1

  • Don't scan all app, exclude third-part apps.
  • Suggest to use collect_requirements command before doing project package.

v0.2.2

  • Output sorting.

v0.2.3

  • Remove collect_requirements command.
  • Test with Django 3.2.

v0.2.4

  • We are not care about Django's version and fastutils' version, so let the end user to choose the version.

v0.2.5

  • Fix bdist_wheel problem that including useless files.

v0.3.0

  • Rename add_app_requires to load_app_requires.
  • Add load_app_middleware_requires.
  • Add load_app_setting_defaults.
  • Add load_app_setting_callbacks.
  • Add patch_all to load_app_requires, load_app_middleware_requires, load_app_setting_defaults and load_app_setting_callbacks.

v0.3.1

  • Fix app_setting_callbacks duplicate load problem.

v0.3.2

  • Doc update.
  • Use zenutils.

v0.3.3

  • Doc update.

v0.3.4

  • Fix unit tests.

v0.3.6

  • Doc update.

Metadata

Release files for django-app-requires 0.3.6

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-app-requires 0.3.6
File Size Uploaded Provenance Actions
django_app_requires-0.3.6.tar.gz 5.9 kB Without provenance Details for django_app_requires-0.3.6.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-app-requires 0.3.6
File Interpreter ABI Platform Actions
django_app_requires-0.3.6-py3-none-any.whl Python 3 none any Details for django_app_requires-0.3.6-py3-none-any.whl

Total release size: 14.6 kB

Release files / django_app_requires-0.3.6.tar.gz

Download URL django_app_requires-0.3.6.tar.gz
Size 5.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f45f3d83d9c216818bda79da1c1f74451b6672bbd0670dce1e2855d6d3c3b1f4
BLAKE2b-256 checksum
How to use checksums
66ecc52bd9e5ee7a590c527216b09bc83eeca4a1868cb4c0055698dbfe476c1f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Release files / django_app_requires-0.3.6-py3-none-any.whl

Download URL django_app_requires-0.3.6-py3-none-any.whl
Size 8.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a66354de9f9203654f76daf4ec32e6ed2191c04abb81429c90728b91fd44cdd7
BLAKE2b-256 checksum
How to use checksums
1393aead9d639463479bc7b8b454d725d0133c55b19853d597bd489205336ae3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.11.12

Security for django-app-requires 0.3.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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