Hi folks,

I am doing the Django tutorial (part 3 _ Django Documentation.htm).

I created an HTML template in a folder within my Django project/ site
(C:\Projects\SASalaries\sasalaries\mytemplates\polls) and my TEMPLATE_DIRS
setting in settings.py is as follows:

TEMPLATE_DIRS = (
    *"C:/Projects/SASalaries/sasalaries/mytemplates",*
    # 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.
)

I created a template as follows:

<!-- Created: 30/01/2010 by coderoid -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional/EN">
<html>
  <head>
    <title>Polls index page.</title>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
    <meta name="generator" content="PyScripter">
  </head>
  <body>
{% if latest_poll_list %}
    <ul>
    {% for poll in latest_poll_list %}
        <li>{{ poll.question }}</li>
    {% endfor %}
    </ul>
{% else %}
    <p>No polls are available.</p>
{% endif %}
  </body>
</html>


Problem is, when i run the dev server and browse to
http://localhost:8000/polls/ i get the following error (full stack trace):

Environment:

Request Method: GET
Request URL: http://localhost:8000/polls/
Django Version: 1.1.1
Python Version: 2.5.4
Installed Applications:
['django.contrib.auth',
 'django.contrib.contenttypes',
 'django.contrib.sessions',
 'django.contrib.sites',
 'sasalaries.polls',
 'django.contrib.admin']
Installed Middleware:
('django.middleware.common.CommonMiddleware',
 'django.contrib.sessions.middleware.SessionMiddleware',
 'django.contrib.auth.middleware.AuthenticationMiddleware')

Template Loader Error:
Django tried loading these templates, in this order:
Using loader django.template.loaders.filesystem.load_template_source:
*c:\projects\sasalaries\sasalaries\mytemplates\polls\index.html (File does
not exist)*
Using loader django.template.loaders.app_directories.load_template_source:
c:\python25\lib\site-packages\django\contrib\admin\templates\polls\index.html
(File does not exist)



Traceback:
File "C:\Python25\Lib\site-packages\django\core\handlers\base.py" in
get_response
  92.                 response = callback(request, *callback_args,
**callback_kwargs)
File "C:\Projects\SASalaries\sasalaries\..\sasalaries\polls\views.py" in
index
  9.     t = loader.get_template('polls/index.html')
File "C:\Python25\Lib\site-packages\django\template\loader.py" in
get_template
  81.     source, origin = find_template_source(template_name)
File "C:\Python25\Lib\site-packages\django\template\loader.py" in
find_template_source
  74.     raise TemplateDoesNotExist, name

Exception Type: *TemplateDoesNotExist* at /polls/
Exception Value: polls/index.html

How does the template "not exist" when i'm looking at it? I have tried:

- moving it to a directory outside the Django installation and modifying my
settings.py TEMPLATE_DIRS accordingly, e.g. to C:\,
- removing all meta data generated my my HTML editor of choice

...and the issue persists. Please enlighten?!
*
BTW*, i'm logged on using an account with full administrator privileges and
my Django installation is running as such.

-- 
Regards,
Sithembewena Lloyd Dube
http://www.lloyddube.com

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to