#9678: Flatpage with URL of "/" ends up in a redirect loop.
------------------------------------+---------------------------------------
          Reporter:  watusee        |         Owner:  nobody    
            Status:  reopened       |     Milestone:            
         Component:  Uncategorized  |       Version:  1.1-beta-1
        Resolution:                 |      Keywords:  flatpage  
             Stage:  Unreviewed     |     Has_patch:  0         
        Needs_docs:  1              |   Needs_tests:  1         
Needs_better_patch:  0              |  
------------------------------------+---------------------------------------
Comment (by flaccid):

 Replying to [comment:11 Daniel Harris]:
 > Replying to [comment:10 flaccid]:
 > > Replying to [comment:9 flaccid]:
 > > apologies forgot to escape the code, of course that reads
 > > {{{
 > > (r'', include('django.contrib.flatpages.urls')),
 > > }}}
 >
 >
 >
 > I believe Malcom's comments above explain (and fix) the problem. For
 flatpages you shouldn't be including anything in your urls.py. The
 flatpages app catches exceptions for pages that do not exist and then look
 them up in the DB before actually throwing a page not found.

 Unfortunately not. I have also tested that on many projects. It throws a
 HTTP 500 for me with the following traceback example:

 {{{
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102] mod_wsgi
 (pid=34592): Exception occurred processing WSGI script '/www/django-
 projects/foo/apache/foo.wsgi'., referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102] Traceback (most
 recent call last):, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]   File
 "/usr/local/lib/python2.6/site-packages/django/core/handlers/wsgi.py",
 line 241, in __call__, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]     response =
 self.get_response(request), referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]   File
 "/usr/local/lib/python2.6/site-packages/django/core/handlers/base.py",
 line 122, in get_response, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]     return
 self.handle_uncaught_exception(request, resolver, sys.exc_info()),
 referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]   File
 "/usr/local/lib/python2.6/site-packages/django/core/handlers/base.py",
 line 166, in handle_uncaught_exception, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]     return
 callback(request, **param_dict), referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]   File
 "/usr/local/lib/python2.6/site-packages/django/views/defaults.py", line
 23, in server_error, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]     t =
 loader.get_template(template_name) # You need to create a 500.html
 template., referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]   File
 "/usr/local/lib/python2.6/site-packages/django/template/loader.py", line
 81, in get_template, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]     source,
 origin = find_template_source(template_name), referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]   File
 "/usr/local/lib/python2.6/site-packages/django/template/loader.py", line
 74, in find_template_source, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]     raise
 TemplateDoesNotExist, name, referer: http://foo.bar/
 [Mon Jul 06 22:35:16 2009] [error] [client 192.168.0.102]
 TemplateDoesNotExist: 500.html, referer: http://foo.bar/
 }}}

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9678#comment:12>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to django-updates@googlegroups.com
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to