Skip to content

About

Auto import modules from all of your apps

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Repository files navigation

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/.

About

Auto import modules from all of your apps

Resources

Contributing

Stars

1 star

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages