Home > Enterprise >  Templates does not exist
Templates does not exist

Time:09-26

How to specify a path to base_site.html that would have views the blog saw it.

enter image description here

CodePudding user response:

You have to do 2 things

  1. Edit the templates settings to include templates folder
  2. Call the template by ‘admin/base_site.html’

CodePudding user response:

First of all add this in your settings.py 'DIRS': [os.path.join(BASE_DIR / "templates")] For Example:

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',
            ],
        },
    },
]

Now change the path or just paste this, and let me know.. return render(request, "admin/base_site.html", {"tasks":tasks})

  • Related