Hi there, there is something I obviously don't understand. According to django reference,
the DetailView has to be provided a slug or pk. I do it in the url but django constantly doesn't
recognize the slug in the url. 'current url doesn't match etc.' what is wrong here? I do everything
like it is explaind and it doesn't work.. very frustrating sometimes...
My models.py:
class List01(models.Model):
name = models.CharField(max_length=100, default='name')
surename = models.CharField(max_length=100, default='surename')
slug = models.SlugField()
views.py
class List(DetailView):
template_name = 'index.html'
model =List01
urls.py
urlpatterns = patterns('',
url(r'^admin/', include(admin.site.urls)),
url(r'^(?P<slug>)$',List.as_view()),
)