from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from blog.models import Post
urlpatterns =[
url(r'^$', ListView.as_view(queryset=Post.objects.all().order_by("-date")[:25], template_name="blog/blog.html")),
url(r'^(\d{1,2})/$', ListView.as_view(queryset=Post.objects.all().order_by("id")[:1], template_name="blog/blogpost.html")),
]
Have you completed the official Django tutorial? It covers this exact question in detail.
https://docs.djangoproject.com/en/1.9/intro/tutorial01/
-James
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/39bcac39-3d06-4796-878c-5051f20375f4%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.