Skip to main content

Auto import a module from all yours apps!

Project description

Project generated with PyScaffold PyPI-Server GitHub Test CI Monthly Downloads

django-app-auto-import

Auto import a module from all yours apps!

Quick Start

# my.project.settings.py
INSTALLED_APPS = [
    ...,
    'cocodev.django.auto_import',
    ...,
]
AUTO_IMPORT = 'startup'  # Automatically imports `startup.py` in all apps

This is a pretty simple library so there is not much more to it.

Preventing Unwanted Code Execution

Through an allow listing:

# my.project.settings.py
AUTO_IMPORT = 'startup'  # Automatically imports `startup.py` in all apps
AUTO_IMPORT_ALLOW_LIST = [
    'my.project.app.name',  # Will only import `my.project.app.name.startup`
]

Through a block list:

# my.project.settings.py
AUTO_IMPORT = 'startup'  # Automatically imports `startup.py` in all apps
AUTO_IMPORT_BLOCK_LIST = [
    'my.project.app.name',  # Won't import `my.project.app.name.startup`
]

Making Changes & Contributing

This project uses pre-commit, please make sure to install it before making any changes:

pip install pre-commit
cd django-app-auto-import
pre-commit install

It is a good idea to update the hooks to the latest version:

pre-commit autoupdate

Don’t forget to tell your contributors to also install and use pre-commit.

Note

This project has been set up using PyScaffold 4.5. For details and usage information on PyScaffold see https://pyscaffold.org/.

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_app_auto_import-1.0.2.tar.gz (26.3 kB view details)

Uploaded Source

Built Distribution

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

django_app_auto_import-1.0.2-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

Details for the file django_app_auto_import-1.0.2.tar.gz.

File metadata

  • Download URL: django_app_auto_import-1.0.2.tar.gz
  • Upload date:
  • Size: 26.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for django_app_auto_import-1.0.2.tar.gz
Algorithm Hash digest
SHA256 2fafebf9334e41ccfbff6c56c7055882cef7018158c1465cbea31b0b6a79e873
MD5 85f5f3598ac7396d2c6562a6e93be24d
BLAKE2b-256 87cf40981a9a91b909c8491c0c4d5a29c39dabeccba0ff7ccfd2d9d1dca8e87d

See more details on using hashes here.

File details

Details for the file django_app_auto_import-1.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for django_app_auto_import-1.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 529535e427fae11cbf4afe59db5aaaf4ba92e66afc1570a9e79fb8612d646c84
MD5 55a9dfbb72c0031630a8ce1fcb64dacf
BLAKE2b-256 19aa432a8ee5a3df3a41ee68d5b5504d6031e5b1ac222cd317461aba325644ec

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