Use base.html of project in installed django package

Hi,
i have this structure (showing only dirs) with one django packages (django-polls) and one project (my site) where i use this package:

./
├── django-polls
│   ├── dist
│   ├── django_polls.egg-info
│   ├── docs
│   └── polls
│       ├── migrations
│       │   └── __pycache__
│       ├── __pycache__
│       ├── static
│       │   └── polls
│       │       └── images
│       └── templates
│           └── polls
└── mysite
    ├── media
    │   └── images
    │       ├── 2018
    │       │   └── gallery
    │       └── sample
    │           └── gallery
    ├── mysite
    │   └── __pycache__
    ├── photo_gallery
    │   ├── migrations
    │   │   └── __pycache__
    │   ├── __pycache__
    │   ├── static
    │   │   └── photo_gallery
    │   └── templates
    │       └── photo_gallery
    ├── portal
    │   ├── migrations
    │   │   └── __pycache__
    │   ├── __pycache__
    │   └── templates
    │       └── portal
    ├── static
    │   ├── admin
    │   │   ├── css
    │   │   │   └── vendor
    │   │   │       └── select2
    │   │   ├── fonts
    │   │   ├── img
    │   │   │   └── gis
    │   │   └── js
    │   │       ├── admin
    │   │       └── vendor
    │   │           ├── jquery
    │   │           ├── select2
    │   │           │   └── i18n
    │   │           └── xregexp
    │   ├── photo_gallery
    │   └── polls
    └── templates
        └── admin

I would like to use the existing base_generic.html in mysite/templates also for the installed app django-polls.
I changed the template in django-polls/polls/template/polls/index.html like this:

{% extends 'mysite/base_generic.html' %}
{% load static %}

{% block head_links %}
    <link rel="stylesheet" type="text/css" href="{% static 'polls/style.css' %}">
{% endblock head_links %}

{% block header %}
    <h1>Polls</h1>
{% endblock header %}

{% block content %}
    {% if latest_question_list %}
        <ul>
        {% for question in latest_question_list %}
            <li><a href="{% url 'polls:detail' question.id %}" >{{ question.question_text }}</a></li>
        {% endfor %}
        </ul>
    {% else %}
        <p>No polls are available.</p>
    {% endif %}
{% endblock content %}

But not working.
Any idea?
Thank you! :slight_smile:
Simón

How do you know that that copy of django-polls is being used? If you have a copy installed in your virtual environment, it’s more likely that it’s that copy your application is using. (Either way, that’s not the way to do this.)

Templates are searched in a specific sequence as documented in the Usage section of the Templates docs.

If you want to override a system-supplied template, see the Overriding Template docs. There’s no need to change package templates.

Thank you!
I will take a look carefully to the links you sent.
:slight_smile:

Cheers,

Simón

Ok, got it.
Just like i did with admin.
Create polls folder in the project´s templates, copy there the polls templates and extend the base template.

Thank u again