Template file not found Django

Tags: , , , ,

I am trying to make a home page of a new website via Django. My app name is ‘blog’, home page is home.html I still receive the error template does not exist when I go to

I made sure I added ‘blog’ to my templates in settings.py and that I added the folder templates in the main directory as well as through blog/templates/blog/home.html


from django.shortcuts import render
from django.http import HttpResponse

def home(request):
    return render(request, 'blog/home.html')


from django.urls import path
from . import views

urlpatterns = [
    path('home/', views.home, name='home'),




        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            os.path.join(BASE_DIR, 'templates')
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [


from django.contrib import admin
from django.urls import path, include

urlpatterns = [
    path('admin/', admin.site.urls),
    path('blog/', include('blog.urls')),

Do you see anything in my code which causes a problem? I receive the message in blog/views.py that “Template file ‘blog’ not found” on the line

return render(request, ‘blog/home.html’)


You are doing it wrong. You need to read the Django documentation carefully and try to understand whatever you read and implement the same step by step. The url you have to hit is

home.html will be rendered at this url. You don’t put html page name in the url

Source: stackoverflow