Django Template url mapping

6 views
Skip to first unread message

RONAK JAIN

unread,
Aug 22, 2019, 2:55:57 AM8/22/19
to django...@googlegroups.com
Hi 

I am new in Django I am doing struggle with add  Django templates using by inheritance.


so when I am trying within Example::  index.html  add inside the blog.html but, I am getting the direct blog.html, not index.html on the index page.


so I used simply in index.html.

index.html:

{%. include  "blog.html"   %}

view.py

class blog(TemplateView):
template_name = "blog.html"

or Can I use templateview for dynamically ?


can you help me with that? how can I render dynamically my blog.html file?.


Thanks



Abu Yusuf

unread,
Aug 22, 2019, 4:28:10 AM8/22/19
to django...@googlegroups.com
Your template name should be: template_name = "index.html"
That's all.

--
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 view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BAqMUdZDk3ce7HY5WTTB0uVNA%3DYsnx3OxUj3x4rf3%3D-2AfMBA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages