Hi I am getting the following error;
error at /
unknown specifier: ?P[
This is what my URLS file looks like;
urlpatterns = patterns('mainpage.views',
(r'^$', 'index'),
(r'^post/(?P<id>\d+)/$', 'post'),
(r'^projects/$', 'projects'),
(r'^about/$', 'about'),
(r'^tags/$', 'tags'),
(r'^tag/(?P[-_A-Za-z0-9]+)/$', 'with_tag'),
(r'^tag/(?P[-_A-Za-z0-9]+)/page/(?Pd+)/$', 'with_tag'),
(r'^comments/$', include('django.contrib.comments.urls'))
The two URLS with a view name of with_tag are the offending urls. I am following this tutorial;
to get tagging working on my site. I am using Django-tagging 1.3.1 and Python 2.7.
Can anyone tell me what I am doing wrong to my URLS.py file please? I am copying the tutorial by the book but there must be something different in my set up compared to the set up used in the tutorial?
This is not related to django-tagging, it's a regex syntax error. ?P indicates a named group, and requires a name after it: ?P<foo>. So, either add names to your groups, or make them numbered (i.e. remove ?P part).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With