On Sun, Jan 18, 2009 at 6:29 PM, [email protected] <
[email protected]> wrote:

>
> I am working my way though the tutorials with Django version 1.0.2; so
> far, so good, until I get stuck about half way through tutorial 3.  I
> have created an index.html file under '/home/tg/templates/polls'.  I
> have specified the  search path(s) for the templates in settings.py as
> follows:
>
> TEMPLATE_DIRS = (
>    '/home/tg/templates',
>    '/home/tg/templates/polls',
> )
>
> and I have configured the views.py file as so:
>
>    t = loader.get_template('index.html')
>
> I have also tried:
>
>    t = loader.get_template('polls/index.html')
>
> No luck: I keep getting a 404 from the browser at the address:
>
>    http://localhost:8000/polls/index.html
>

I'm a little confused by what you are saying here.  Are you attempting to
type that url in in the address bar?  You are supposed to use just:

http://localhost:8000/polls/

which per the url configuration the tutorial has you set up causes your
polls index view to be called, which in turn loads the index.html template.
If that code runs into a problem loading the template you will get a debug
page (assuming you have DEBUG set to True) that starts with:

TemplateDoesNotExist at /polls/
polls/index.html

and continues with a full template loader post-mortem of what all paths it
searched attempting to find the template, which is usually enough to figure
out what's going wrong in cases where the template has been placed in the
wrong directory.  But it doesn't sound like you are getting that?

Karen

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

Reply via email to