Thursday, February 3, 2011

Re: matching a domain name in urls.py

Hi Mike,

May I suggest RegexBuddy for anything regex related in the future, it have saved me a *lot* of time!

Cal

On Thu, Feb 3, 2011 at 4:44 PM, mike171562 <support.desk.ipg@gmail.com> wrote:
I am building an app that passes a domain name to urls.py like so   "/
sites/domain.com/'

but I cannot get my urls.py to match the 'domain.com'  it only seems
to match if i just use domain without the dot

I have tried

   (r'^zones/^[^/]+/', get_domain),
   (r'^zones/(?P<domain>\w+)/', get_domain),
   (r'^zones/(?P<domain>\w+)$', get_domain),

and none seem to be able to catch it

--
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.


--
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.

No comments:

Post a Comment