0

What I had in mind was something along the lines of

{% if <"the current page url = '/'"> %}
    {% include '...' %}  

How can I make this work using template tags?

Jay Jung
  • 1,805
  • 3
  • 23
  • 46

1 Answers1

2

You can try request.path to get url path.

Other answer :

You can create your custom template context processor where you can store current page url.

Link : https://docs.djangoproject.com/en/1.10/ref/templates/api/#writing-your-own-context-processors

Prashant Gaur
  • 9,540
  • 10
  • 49
  • 71
  • Is creating a custom template context processor just another way of saying "create a variable for request.path in your view and pass it to the context"? Or is it something inherently different? – Jay Jung Dec 12 '16 at 07:08