Sunday, April 22, 2012

URL regex not matching

Hello All,
I need some urgent help with this one. Am trying to show a user profile when the user navigates to a url of this format 


I have provided the following expression in my urls.py file

(r'^user/(\w+)/$','accounts.views.userProfile'),

this working fine for normal usernames, but if the user add a . (dot) in between his username the url do not match with the regex and throws Page not found error.

Since the django username supports  Letters, digits and @/./+/-/_  i want all these to be supported in my url. Could someone please help me to construct the url. Am pretty weak in regex and it will take me sometime to build a proper regex for the above url. Thanks

Regards,

Swaroop Shankar V

--
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 django-users+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/django-users?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate