django-components
django-components copied to clipboard
Create simple reusable template components in Django.
updates: - [github.com/pycqa/flake8: 4.0.1 → 5.0.2](https://github.com/pycqa/flake8/compare/4.0.1...5.0.2)
 I have an issue, using COMPONENTS = {"RENDER_DEPENDENCIES": True} in settings, specific error is response["Content-Type"], this issue is for media loading.
You need to add 'django_components.middleware.ComponentDependencyMiddleware' to your MIDDLEWARE section too, that's the thing that makes smarter choices of where to import CSS and JS. _Originally posted by @EmilStenstrom in https://github.com/EmilStenstrom/django-components/discussions/70#discussioncomment-880635_
In the default example in the README this Media definition is used: ```python class Media: css = '[your app]/components/calendar/calendar.css' js = '[your app]/components/calendar/calendar.js' ``` I would like to simplify this...
It seems to me that `{% block %}` tags should be executed first, and only after blocks are filled should components parse and fill their slots. This would enable use-cases...
Nested components does not work today, and I think this might be a common case for people using components in bigger projects. When nesting components, you quickly run into the...
Some components might have optional slots, e.g.: ``` {% slot "title" %}Title{% endslot %} {% slot "subtitle" %}Optional subtitle{% endslot %} ``` If implemented as above, the the subtitle div...
Making two extra HTTP requests for each component on the page makes sense with few components. It will even be decently efficient when using HTTP/2 or later. But as the...