How do I use a template from one app in another app

How do I use a template from one app in another app

Currently trying to make a social application. I created two apps Main and posts. My post app will handle all functionality for creating, deleting a post, list of posts. My Main app is my homepage which would display all posts, for example similar to a facebook's homepage.

Currently trying to make a social application. I created two apps Main and posts. My post app will handle all functionality for creating, deleting a post, list of posts. My Main app is my homepage which would display all posts, for example similar to a facebook's homepage.

Main app currently authenticates users and what not. I created views and template for my posts app and I now want to include it on the Main's app homepage. Not sure how to go out about doing this. Not asking for anyone to write up the code but at least give a structure on how to achieve this.

Basic Structure of the app:

--Main_app
  --_views.py
  --templates
    --home.html
--posts_app
  --_views.py
  --templates
    --posts.html

One of the files my posts_app views contains currently is:

def posts_list(request):
    #return HttpResponse("<h1> List a posts. </h1>")
    render(requests, "posts.html", {})

templates/posts.html contains this file:

<!DOCTYPE html>
<html lang="en">
  <body>
    <h1>Posts template is working</h1>
  </body>
</html>

And in my main_app templates/html:

{% if user.is_authenticated %}
<h1>Homepage</h1>
<!-- Posts template -->
{% include "posts/templates/posts.html" %} 
{% endif %}

It made sense to me at the time to just import the template from the posts app to the main app and it would work. Did not work obviously, so I did a bit of research and couldn't find a definite solution, is there thing called templates inheritance, should import my views from posts into main. I'm not sure. Any help is appreciated.

Angular 9 Tutorial: Learn to Build a CRUD Angular App Quickly

What's new in Bootstrap 5 and when Bootstrap 5 release date?

Brave, Chrome, Firefox, Opera or Edge: Which is Better and Faster?

How to Build Progressive Web Apps (PWA) using Angular 9

What is new features in Javascript ES2020 ECMAScript 2020

Python Django Tutorial | Django Course

🔥Intellipaat Django course: https://intellipaat.com/python-django-training/ 👉This Python Django tutorial will help you learn what is django web development &...

How to Integrate Django to any Javascript Front End // Django to React // Django to Angular

Learn the basic technique to Integrate Django to any Javascript Front End // Django to React // Django to Angular

Django

Well i used django ... i want to know after completing all the coding stuff, can i make all the codes online ?