Skip to content

Instantly share code, notes, and snippets.

@dimiro1
Last active May 21, 2019 19:07
Show Gist options
  • Save dimiro1/37011c102e138812acdb0d9669bd9ff6 to your computer and use it in GitHub Desktop.
Save dimiro1/37011c102e138812acdb0d9669bd9ff6 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Page Title</title>
</head>
<body>
<header>This is the header, this is the same on all pages</header>
{% block content %}This content we can override on child templates{% endblock %}
{% block footer %}
<footer>This is the footer, it appears in all pages</footer>
{% endblock %}
</body>
</html>
{% extends "base.html" %}
{% block content %}
{# This is a more complex example #}
{% block content_signup %}
{% endblock %}
{% endblock %}
{% extends "base_login_signup.html" %}
{% block content_signup %}
This is specific to the login page
{% endblock %}
{% block footer %}
<footer>This footer is specific to the login</footer>
{% endblock %}
{% extends "base_login_signup.html" %}
{% block content_signup %}
This is the merchant login page
{% endblock %}
{% extends "base.html" %}
{% block content %}
This is the profile page
{% endblock %}
{% extends "base_login_signup.html" %}
{% block content_signup %}
This is specific to the signup page
{% endblock %}
{% block footer %}
<footer>This footer is specific to the signup page</footer>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment