Hey, I have a url regex like this which is keeping django extremely busy 
(20secs to 1min to handle a request). On some urls it even crashes.

my regex:

url(r'^(?P<item_url>(\w+-?)*)/$', 'detail'),


view:

def detail(request, item_url):
   i = get_object_or_404(Page, url=item_url,published=True)
   return render_to_response('item/detail.html', {'item':i},
       context_instance=RequestContext(request))

replaced with:

url(r'^(?P<item_url>[\w-]+)/$', 'detail'),


The replacement works like a charm. What is wrong with the first regex?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/django-users/-/lVIrewdZipMJ.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to