[Django]-Django: TemplateDoesNotExist at /

2πŸ‘

βœ…

To fix the problem, add piggybank to INSTALLED_APPS in your settings.

In your TEMPLATES setting, you have:

'APP_DIRS': True,

This is the default, and means that Django will look at the templates directory for each app in INSTALLED_APPS. In the post mortem you can see:

django.template.loaders.app_directories.Loader: /home/anna/starling/lib/python3.6/site-packages/django/contrib/admin/templates/starling/index.html (Source does not exist)
django.template.loaders.app_directories.Loader: /home/anna/starling/lib/python3.6/site-packages/django/contrib/auth/templates/starling/index.html (Source does not exist)

It’s not looking in the piggybank/templates directory because you haven’t added piggybank to INSTALLED_APPS yet.

πŸ‘€Alasdair

0πŸ‘

You need are missing TEMPLATES DIR

read this django templates

try this

settings.py

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [os.path.join(BASE_DIR, 'templates')],   # your dir template path
πŸ‘€rahul.m

0πŸ‘

I got this error when I forgot to add the app in installed apps:

INSTALLED_APPS = [
...
   'app.apps.AppConfig',
...
]

app is the name of you app, so if your apps name was myApp,

then it would be: 'myApp.apps.MyappConfig',

πŸ‘€AnonymousUser

Leave a comment