On Apr 7, 11:08 am, bobhaugen <[EMAIL PROTECTED]> wrote:
> My view that creates a new order ends with this statement:
> return HttpResponseRedirect('%s/%s/'
> % ('order', new_order.id))
You should be able to just place a slash in front of your redirect
statement so it looks like this:
return HttpResponseRedirect('/%s/%s/' % ('order', new_order.id))
>
> The 'order' URL fragment is appended to the orderentry form URL like
> so:
> (first url)http://127.0.0.1:8000/orderentry/order/4/
>
> You can get to the same 'order' view using more direct paths,
> resulting in a nicer URL like:
> (second url)http://127.0.0.1:8000/order/4/
>
> The result of all the above is that I needed two different urlpattern
> members, like so:
> urlpatterns = patterns('',
> url(r'^order/(?P<order_id>\d+)/$', order),
> url(r'^orderentry/order/(?P<order_id>\d+)/$', order),
> )
>
> What (if anything) am I doing wrong here? How can I get the first URL
> to be like the second one?
Steve
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---