I have a set of modules that get included in all of my main templates in all of my apps, but these modules require database access, which works fine in the home app but to make it work in the other apps I would have to copy/paste the view from home to the other apps. idk if this is making sense so I’ll show my code:
#index.html
<body>
<header>
{% include "home/mobile_nav.html" %}
{% include "home/desktop_nav.html" %}
{% include "home/hero.html" %}
</header>
<main>
<div id='call_to_action'>
<h3>Ready to Shape the Future?</h3>
<p>Click Here</p>
</div>
<div id='recent'>
<h2>Recent Work</h2>
{% if latest_projects_list %}
{% for project in latest_projects_list %}
<a href="#placeholder"><img src="http://source.unsplash.com/100x150/" alt=""></a><!--placeholder src-->
{% endfor %}
{% else %}
<p id="recent_else">No projects available.</p>
{% endif %}
</div>
</main>
{% include "home/footer.html" %}
</body>
the footer and navs pull data from the projects and posts models. because the index view contains those data pulls, it works fine there, but I would have to copy those data pulls to all the other views to make them work there. Is there a way I can, for example, make a view specifically for footer.html?