0

Hi everybody.

My question is. I made an html template that I will extend in every other html pages. And this template have some variables. So my question is how to assign a function to this base template.
Let me be more clear and give you an example:

base.html

...
...
    {% if auth_form.has_errors %}
        ---- do something -----

    {% if true_flag %}
        ----- do something ----


    and so on...
....
....

some_page.html

{% extends 'base.html' %}

    ----------do something -------

So my question is how to create a function in views.py (or I don't know may be I have to change urls.py) in such way that in some_page.html I don't need to specify what is auth_form or true_flag.....

2
Contributors
1
Reply
2
Views
5 Years
Discussion Span
Last Post by ScottieF
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.