EmilStenstrom / django-components

Create simple reusable template components in Django.
MIT License
953 stars 60 forks source link

refactor: fix clash with autodiscovery #435

Closed JuroOravec closed 1 month ago

JuroOravec commented 1 month ago

Fixes https://github.com/EmilStenstrom/django-components/issues/431

This was a lot of trial and error, but it seems that by using importlib.import_module(module_name), we don't have to interact with the sys.modules. Instead, we just pass it a python import like "myapp.components.calendar". And so, there are no conflcts with 3rd party libraries anymore.

I wonder what would be a good way to test this:

EmilStenstrom commented 1 month ago

Released as part of 0.66, great work @JuroOravec!