Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6942417
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:00:50+00:00 2026-05-27T13:00:50+00:00

I am currently following along with a somewhat questionable Django tutorial called A complete

  • 0

I am currently following along with a somewhat questionable Django tutorial called A complete blog engine using Django in 60 minutes and am stuck on page 6. So I have a Django project called blog and an inside I’ve an app called blogengine. Currently I am getting a TemplateDoesNotExist exception when I try loading

127.0.0.1:8000/blog/

Here is the full Traceback:

Environment:


Request Method: GET
Request URL: http://127.0.0.1:8000/blog/

Django Version: 1.3.1
Python Version: 2.7.2
Installed Applications:
['blogengine',
 'django.contrib.admin',
 'django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.middleware.csrf.CsrfViewMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware',
 'django.contrib.messages.middleware.MessageMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.Loader:
/home/sez/blog/templates/blogengine/post_list.html (File does not exist)
Using loader django.template.loaders.app_directories.Loader:
/usr/local/lib/python2.7/site-packages/django/contrib/admin/templates/blogengine/post_list.html (File does not exist)



Traceback:
File "/usr/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  111.                         response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python2.7/site-packages/django/views/generic/list_detail.py" in object_list
  107.     t = template_loader.get_template(template_name)
File "/usr/local/lib/python2.7/site-packages/django/template/loader.py" in get_template
  157.     template, origin = find_template(template_name)
File "/usr/local/lib/python2.7/site-packages/django/template/loader.py" in find_template
  138.     raise TemplateDoesNotExist(name)

Exception Type: TemplateDoesNotExist at /blog/
Exception Value: blogengine/post_list.html

In the Template Loader Error you can see Django tries to look for the post_list.html template in the /home/sez/blog/templates/blogengine/' directory. To get this working I have to make Django look in the/home/sez/blog/templates/blog/’ directory but I still do not fully understand how URLconf works.

Below are my 2 url.py files. The first is my project level url.py

from django.conf.urls.defaults import patterns, include, url
from django.views.generic.simple import direct_to_template
from blog.views import *

from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
        (r'^admin/', include(admin.site.urls)),
        (r'^static/(.*)$',
            'django.views.static.serve',
            {'document_root': '/home/siddhion/blog/static/'}),
        (r'^(?P<template>\w+)$', direct_to_template),
        (r'^$', static_page, {'template':'base'}),
        (r'^blog/', include('blog.blogengine.urls')),
        url(r'^(?P<template>\w+)/$', static_page, name='static_page'),
        )

As I understand it, the line (r'^blog/', include('blog.blogengine.urls')), is telling redirecting control over to the url.py file in my blogengine directory. Here is the code for that file

from django.conf.urls.defaults import *
from django.views.generic import list_detail
from blog.blogengine.views import Post

urlpatterns = patterns('',
        url(r'^$',
            list_detail.object_list,
            {
                'queryset': Post.objects.all(),
                'template_object_name':'post',
            },
            name='blog_home'
            ),
    )

So how what edits would I have to make to my urls.py files in order to get Django to find and render the post_list.html template?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T13:00:50+00:00Added an answer on May 27, 2026 at 1:00 pm

    Assuming that the file /home/sez/blog/templates/blog/post_list.html exists, you only have to tell Django where to look for it. Apparently, it looks for your templates in /home/sez/blog/templates/blogengine/. You can change that by adjusting TEMPLATE_DIRS in your settings.py:

    TEMPLATE_DIRS = (
        # Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
        # Always use forward slashes, even on Windows.
        # Don't forget to use absolute paths, not relative paths.
        '/home/sez/blog/templates/blog',
    )
    

    However, it is common practice to name the template subdirectories as their corresponding apps, so you might want to consider moving your templates to blogengine, where Django assumes they are at the moment.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm following along with a winsock tutorial in MASM's syntax called: Iczelion's Guide to
I'm currently following the third tutorial listed here: here where I'm trying to compile
I'm currently following: http://railsontherun.com/2007/10/04/sexy-charts-in-less-than-5-minutes/ I went through it all pretty easily, but then when
I'm currently following a tutorial in a book, and it instructs to create a
I am using currently the following code to populate a combobox: combobox.DataSource = datatable;
I am currently following NeHe tutorial lesson 43 ( http://nehe.gamedev.net/data/lessons/lesson.asp?lesson=43 ). The code works
Currently following is the setup of my wifi connection. Laptop 1 ------> Wifi Router
I'm starting to use Role Management in my website, and I'm currently following this
I'm currently having following error message when executing a .sql file with about 26MB
I currently use the following command, but it's a little unwieldy to type. What's

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.