Don't understand regex-urls and DetailView...

13 views
Skip to first unread message

inoyon artlover KLANGRAUSCH

unread,
Mar 11, 2015, 4:57:34 PM3/11/15
to django...@googlegroups.com
I don't understand why this doesn't work and smashes an

'The current URL, lighter, didn't match any of these.'

my models.py

class ShopList(models.Model):
    name = models.CharField(max_length=100, null=True, blank=True)
    description = models.CharField(max_length=100, null=True, blank=True)
    slug = models.SlugField(unique=True, null=True, blank=True)

my views.py

class ProductView(DetailView):
    model = models.ShopList
    template_name = "product.html"

and finally urls.py

url(r'^(P?<slug>\w+)$', views.ProductView.as_view()),

Where is the mistake here????????????

inoyon artlover KLANGRAUSCH

unread,
Mar 11, 2015, 5:04:14 PM3/11/15
to django...@googlegroups.com
I got it! :D (?P<slug>\w+) and NOT (P?<slug> .....
Reply all
Reply to author
Forward
0 new messages