Al 17/08/12 17:42, En/na Rafael Romero Carmona ha escrit:
Hi, I'm learning Django and I have problems with the urls.py. I show you
how that's writed:
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('users.views',
url(r'^volunters/$', 'voluntersindex'),
url(r'^volunters/(?V<volunter_id>\d+)/$', 'volunterdetails'),
url(r'^organizers/$', 'organizersindex'),
url(r'^organizers/(?O<organizer_id>\d+)/$', 'organizerdetails'),
url(r'^events/$', 'eventsindex'),
url(r'^events/(?E<event_id>\d+)/$', 'eventdetails'),
)
urlpatterns += patterns('',
url(r'^admin/', include(admin.site.urls)),
)
When I try to show admin/, organizers/ and events/ I receive a menssage
like:"unexpected end of pattern; Exception Location:
/usr/lib/python2.6/re.py in _compile, line 245"
How can I fix it? Thanks and sorry if I have errors in my sentences.
The regular expressions are wrong, Try with (?P<volunter_id>\d+) etc.
HTH
--
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+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en.