using extends more than once

17 views
Skip to first unread message

Rootz

unread,
Sep 6, 2018, 2:34:36 AM9/6/18
to Django users
Can a child template have more than one parent template?
I am using the the latest release for Django and I have several template to include
in the one template file. How can I do so using template inheritance (using the default django template api) ?

Andréas Kühne

unread,
Sep 6, 2018, 10:37:22 AM9/6/18
to django...@googlegroups.com
Short answer: 
You can't - at least not with extends. Extends is for one base template to be used for all default things you need on a HTML template.

Long answer:
You can include templates in another template. If you have one template and you need to include other templates in that template then you can use the include template tag:

However you can only include templates and not views....

Regards,

Andréas


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5110b6a9-6b53-4a7d-b235-34e967de4361%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages