how can i fix the "TemplateDoesNotExist at /" issue please

Please do not post images of error messages - copy/paste the errors from your server console.

What do you think this error message is telling you? What information is presented here that might help you find the cause of the error?

What file does it say is missing?

Where is that file located?

Where is it telling you that it is looking for that file?

1 Like

i don’t know what file that why i came here for help please.

It’s in the error message, the line titled “Exception Value”.

from django.shortcuts import render

Create your views here.

def post_list(request):
return render(request, ‘blog/post_list.html’, {})

but i did it it is available on the views.py

That’s not what that message it telling you.

It’s saying it cannot find a file by that name.

Does that file exist? If so, in what directory?

Under the blog directory.

It goes this way from my desktop folder…desktop/myapp/blog/
then everything else re on the blog directory

What files are in the desktop/myapp/blog directory? List them all.

Also, are you working from a book or some other tutorial material? If so, what’s your source.

i started my project (myapp) on the desktop directory. myapp is where i have the manage.py, setting.py models.py app.py, views.py, urls.py, tests.py, admin.py, init.py and all. In myapp i created a folder (blog) which i also added to INSTALLED_APPS in settings.py. So in the blog directory i make another directory (Templates) while under the template i created another directory (blog) # blog/templates/blog then create a file under the last blog directory which is (post_list.html). For my website http://127.0.0.1:8000/ to get rid of the bug #TemplateDoesNotExist at /

Djangogirls tutorial

Your models, views, urls, etc do not belong in your project directory.

For a detailed description of a project layout see Is the structure of the project correct? - #2 by KenWhitesell.

Notice the error messages. This is where Django looked for your template file. Post a screenshot of these folder content to see if the file is there.