On 30/01/13 16:38, Shawn H wrote:
I posted this question yesterdat at stack overflow
<http://stackoverflow.com/questions/14589244/why-would-django-get-request-with-long-url-lock-python>,
but I'm wondering if this is a bug. I have a url that accepts one
text parameter, allows spaces, and calls a very simple view that
checks if there are objects with a project name that matches the text
parameter value. The view returns a simple json string indicating
whether there's a project with that name already in the database. It
works great, repeatedly, with short parameter values. It locks up
python on certain long string values. I've tested up to 50
characters, and just length doesn't trigger it. What does seem to
repeatedly trigger it are long strings with multiple spaces. I've
tested my url regex matching and those long strings match just fine;
my concern is that for some reason inside the view that long string is
causing problems. I'm using Django 1.4 with the built in webserver
for testing. Any help that can be provided will be greatly
appreciated. --
Hi Shawn,
I've answered your question on Stack Overflow, but I'll post it here as
well:
Since you are going to check whether `aProjectName` already exists in
the database, there's no need for you to make the regex so complicated.
I suggest you simplify the regex to
url(r'^chargeback/checkDuplicateProject/(?P<aProjectName>[\w+\s-]*)/$',
'chargeback.views.isProjectDuplicate'),
For a further explanation, see the question "url regex keeps django
busy/crashing" [1] from the django-users group.
[1]: https://groups.google.com/d/msg/django-users/Bxq9i0mttSc/DEz7S7M8lxAJ
Cheers,
Alasdair
--
Alasdair Nicol
Developer, MEMSET
mail: alasd...@memset.com
web: http://www.memset.com/
Memset Ltd., registration number 4504980. 25 Frederick Sanger Road, Guildford,
Surrey, GU2 7YD, UK.
--
You received this message because you are subscribed to the Google Groups "Django
users" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.