2๐
You need to pass a list in a variable or object, you can do it like this:
{% include "partials/pickUp-Order-Form.html" with form="list test".split %}
or you can create the variable first and then pass it to the include tag:
{% with "list test" as list %}
{% include "partials/pickUp-Order-Form.html" with form=list.split %}
{% endwith %}
-2๐
The include
django template tag can be used for loading and rendering HTML templates where the context/data that was passed to the original template gets passed.
You can find documentation about this functionality in the built-ins section.
So if you would like to include a template, of which original view that renders the template has the following context dict: {'word': 'Bird', 'power_level': 9001}
you can render it inside another template with: {% include "word_template.html" with word="Not a Bird" power_level="470" %}
, which will in turn change the values to the desired ones.
To answer the question:
It should work
Taking into consideration you include
a template which will not use the list
type as something else.
- [Django]-Django-OIDC with keycloak โ OIDC callback state not found in session oidc_states
- [Django]-How does djangoproject.com do its deploy to prod? Should I package my django project to deploy it?