Hi,

I face the same problem as haver too when I followed the tutorial at
(http://www.djangoproject.com/documentation/0.96/tutorial03/).

I don't think we were supposed to change the URL config. Apparently
the loader.get_template should have loaded index.html from the
template directory, but it returned a 404 error for some reasons.
Quoted from the site:

"When you've done that, create a directory polls in your template
directory. Within that, create a file called index.html. Note that our
loader.get_template('polls/index.html') code from above maps to
"[template_directory]/polls/index.html" on the filesystem."

--Vincent

On Dec 15, 5:33 am, "J. Clifford Dyer" <[EMAIL PROTECTED]> wrote:
> On Fri, Dec 14, 2007 at 01:01:37PM -0800, haver wrote regarding stuck with 
> tutorial 3 at - Write views that actually do something:
>
>
>
>
>
> > Hi All,
>
> > I started with django and went through 2.5 tutorials relatively
> > painless, but nevertheless I stuck on tutorial #3. I tried to modify
> > regular expression, but error getting more complecated.
> > help needed fixed the urls.py (my guess)
> > thanks,
>
> > Vadim
>
> > Error message:
> > Request Method: GET
> > Request URL:http://localhost:8000/polls/index.html
>
> > Using the URLconf defined in mysite.urls, Django tried these URL
> > patterns, in this order:
>
> > ^polls/$
> > ^polls/(?P<poll_id>\d+)/$
> > ^polls/(?P<poll_id>\d+)/results/$
> > ^polls/(?P<poll_id>\d+)/vote/$
> > The current URL, polls/index.html, didn't match any of these.
>
> The $ means match the end of the url.  So
>
> ^foo/$
>
> means match a url that begins and ends with "foo/".
>
> Which of your URL regular expressions would you expect to match 
> polls/index.html?
>
> Assuming you want your index to show the list of polls, drop index.html from 
> the URL in your browser.  If you need index.html there for legacy reasons, 
> change your urls.py file to include index.html before the $.  For example:
>
> ^polls/index.html$
>
> But then you won't match unless you have index.html in your URL, which is 
> probably even worse.
>
> If you aren't dealing with a legacy site, I would just drop the index.html.  
> It just makes your URLs uglier, and less accurate (because you aren't 
> actually serving up flat HTML).
>
> Cheers,
> Cliff
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
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