1π
β
I would use a base template containing all your common stuff (JQuery, main.css).
So, you will have a template called base.html
will all the basic stuff and placeholders for specific pages content:
<html>
<head>
<link rel="stylesheet" type="text/css" href="{{ STATIC_URL }}/css/main.css">
{% block additional_header %}
{% endblock %}
</head>
<body>
{% block content %}
{% endblock %}
</body>
</html>
Then, your actual page will be a template with something like this:
{% extends 'base.html' %}
{% block content %}
This is specific content for your page
{% endblock %}
Checkout Djangoβs official documentation. Look for the section titled Template Inheritance
.
π€Pablo Santa Cruz
Source:stackexchange.com