python – TemplateDoesNotExist at / on Heroku while working on local server

New to Django and Heroku;

I get “TemplateDoesNotExist at /” when loading the page. Have read somewhere that it might have something to do with Caps.

My template is called templates.

In settings.py :

from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent 
print(BASE_DIR)
print(BASE_DIR / 'templates')

And

TEMPLATES = (
{
    'BACKEND': 'django.template.backends.django.DjangoTemplates',
    'DIRS': (BASE_DIR / 'templates'),
    'APP_DIRS': True,
    'OPTIONS': {
        'context_processors': (
            'django.template.context_processors.debug',
            'django.template.context_processors.request',
            'django.contrib.auth.context_processors.auth',
            'django.contrib.messages.context_processors.messages',
        ),
    },
},

)

HOWEVER

in the error, I get :
“django.template.loaders.filesystem.Loader: /app/Templates/homepage.html (Source does not exist)”

It seems like Heroku doesn’t upload the changes I’ve made to settings.py even though I get “Everything up-to-date”

Everybody seems to be using os.path.join but my Pathlib is working correctly (I assume).

Thanks in advance for any help 🙂

python – Django | TemplateDoesNotExist at / home/index.html

Por algún motivo, hoy el directorio templates no lo encuentra la aplicación. Es curioso, ya que no recuerdo haber tocado nada que estuviera relacionado con el directorio.

Error:

TemplateDoesNotExist at /
home/index.html

Recorte:

introducir la descripción de la imagen aquí

Árbol de directorios:

introducir la descripción de la imagen aquí

settings>base.py

# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent

    TEMPLATES = (
        {
            'BACKEND': 'django.template.backends.django.DjangoTemplates',
            'DIRS': (os.path.join(BASE_DIR, 'templates')),
            'APP_DIRS': True,
            'OPTIONS': {
                'context_processors': (
                    'django.template.context_processors.debug',
                    'django.template.context_processors.request',
                    'django.contrib.auth.context_processors.auth',
                    'django.contrib.messages.context_processors.messages',
                ),
            },
        },
    )

manage.py

#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys

def main():
    """Run administrative tasks."""
    os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'testosakidetza.settings.local')
    try:
        from django.core.management import execute_from_command_line
    except ImportError as exc:
        raise ImportError(
            "Couldn't import Django. Are you sure it's installed and "
            "available on your PYTHONPATH environment variable? Did you "
            "forget to activate a virtual environment?"
        ) from exc
    execute_from_command_line(sys.argv)


if __name__ == '__main__':
    main()

applications>home>urls.py

from django.urls import include, path
from . import views

app_name = 'home_app'

urlpatterns = (

    path('',
        views.HomePageView.as_view(),
        name='home',
    ),   
)

applications>home>views.py

from django.shortcuts import render
from django.views.generic import (
    TemplateView,
    ListView
)
from .models import Home
class HomePageView(TemplateView):
    template_name = "home/index.html"