Xzya / django-web-components

A simple way to create reusable template components in Django.
MIT License
159 stars 4 forks source link

Autodiscovery components.py files #15

Open ralfbraendli opened 4 months ago

ralfbraendli commented 4 months ago

Would it be possible to add autodiscovery for components?

Here is an example code for the apps.py file

from django.apps import AppConfig
from django.utils.module_loading import autodiscover_modules

class DjangoWebComponentsAppConfig(AppConfig):
    name = "django_web_components"
    verbose_name = "Django Web Components"

    def ready(self):
        autodiscover_modules("components")