OMG. I can't believe I missed the trailing slash when I set up the
get_absolute_url for the results page. I need sleep.

Thanks Karen,
Brandon

On May 22, 4:19 pm, "Karen Tracey" <[EMAIL PROTECTED]> wrote:
> On Thu, May 22, 2008 at 3:21 PM, Brandon Taylor <[EMAIL PROTECTED]>
> wrote:
>
>
>
> > Hi everyone,
>
> > I'm having a problem with an url pattern. When I try to do a custom
> > view using the newforms admin, such as:
>
> > (r'^admin/surveys/survey/answers/(?P<slug>[-\w]+)/$',
> > 'app.surveys.views.answers_list'),
>
> This urlpattern requires a trailing slash.  Does one exist in the url you
> are tying to use?
>
> > If I remove:
>
> > (r'^admin/(.*)', admin.site.root),  #the default routing for newforms-
> > admin.
>
> > It works, otherwise it returns an error saying:
> > survey object with primary key u'answers/whatever-the-slug-is' does
> > not exist.
>
> > Which would lead me to believe that it's not routing to the proper
> > action. Is anyone else experiencing this? What can I do to solve this
> > issue?
>
> The second urlpattern will catch even urls that do not end in a trailing
> slash.  So if it is present in your urlconf, and the first urlpattern
> doesn't match because of the mismatch in trailing slash, it will get used.
> If you remove this catch-all pattern, then the APPEND_SLASH/CommonMiddleware
> behavior described here:
>
> http://www.djangoproject.com/documentation/middleware/#django-middlew...
>
> will kick in (assuming common configuration) and and on the second go-round
> (with a trailing slash automatically appended) your intended urlpattern will
> match.
>
> Karen
--~--~---------~--~----~------------~-------~--~----~
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