Consider the following base.html:
<!DOCTYPE html> <html> <head> <title>django-protocolify demo</title> </head> <body> <ul> {% block navigation %} <li><a href="{% url home %}">Home</a></li> <li><a href="{% url shop %}">Shop</a></li> <li><a href="{% url about_us %}">About Us</a></li> {% endblock navigation %} </ul> <div class="content"> {% block content %} <p>No content here</p> {% endblock content %} </div> </body> </html>
Now consider being on a "Payments" page that uses HTTPS. If the user clicks on
one of the navigation links from the base template, they'll still be using
HTTPS. django-protocolify solves this:
{% extends "base.html %} {% load protocolify %} {% block navigation %} {% protocolify to "http" %} {{ block.super }} {% endprotocolify %} {% endblock %} ...
If it sounds useful, go and check it out.
No comments:
Post a Comment