Advertisement
Guest User

urls.py

a guest
Jan 21st, 2014
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. from django.conf.urls import patterns, include, url
  2. from django.views.generic import ListView, DetailView
  3. from blogger.models import Post
  4.  
  5.  
  6. urlpatterns = patterns('blogger.views',
  7. url(r'^$', ListView.as_view(
  8. queryset=Post.objects.all().order_by('-created')[:3],
  9. template_name="blogger/blog.html")),
  10. url(r'^(?P<pk>\d+)$', DetailView.as_view(
  11. model = Post,
  12. template_name="blogger/post.html")),
  13.  
  14. url(r'^archives/$', ListView.as_view(
  15. queryset=Post.objects.all().order_by('-created'),
  16. template_name="blogger/archives.html")),
  17.  
  18. url(r'^tag/(?P<tag>\w+)$', 'tagpage'),
  19. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement