Example #1
0
from django.views.generic import ListView, DetailView
from blogengine.models import Post, Category, Tag
from blogengine.views import CategoryListView, TagListView, PostsFeed

urlpatterns = patterns('',
    # Index
    url(r'^(?P<page>\d+)?/?$', ListView.as_view(
        model=Post,
        paginate_by=5,
        )),

    # Individual posts
    url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$', DetailView.as_view(
        model=Post,
        )),

    # categories
    url(r'^category/(?P<slug>[a-zA-Z0-9]+)/?$', CategoryListView.as_view(
    	model=Category,
    	paginate_by=5, 
    	)),

    # tags
    url(r'^tag/(?P<slug>[a-zA-Z0-9]+)/?$', TagListView.as_view(
        model=Tag,
        paginate_by=5, 
        )),

    # post RSS feed
    url(r'^feeds/posts/$', PostsFeed()),
)
Example #2
0
File: urls.py Project: reg3x/pyblog
    DeletePost,
    DashBoardView,
)

urlpatterns = patterns(
    "",
    # Index
    url(regex=r"^(?P<page>\d+)?/?$", view=BaseView.as_view(), name="home"),
    # Individual posts
    url(
        regex=r"^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$",
        view=SingleView.as_view(),
        name="post",
    ),
    # Categories
    url(regex=r"^category/(?P<slug>[a-zA-Z0-9-]+)/?$", view=CategoryListView.as_view(), name="category"),
    # Tags
    url(regex=r"^tag/(?P<slug>[a-zA-Z0-9-]+)/?$", view=TagListView.as_view(), name="tag"),
    # Post RSS feed
    url(regex=r"^feeds/posts/$", view=PostsFeed()),
    # Log in
    url(regex=r"^login/$", view="django.contrib.auth.views.login"),
    # Log out
    url(regex=r"^logout/$", view="django.contrib.auth.views.logout", kwargs={"next_page": "home"}),
    # Dashboard
    url(regex=r"^dashboard/$", view=DashBoardView.as_view(), name="dashboard"),
    # Add Post
    url(regex=r"^post/add/$", view=AddPost.as_view(), name="addpost"),
    # Update Post
    url(regex=r"^post/update/(?P<slug>[a-zA-Z0-9-]+)?$", view=UpdatePost.as_view(), name="updatepost"),
    # Delete Post
Example #3
0
from django.conf.urls import patterns,url
from django.views.generic import ListView,DetailView
from blogengine.models import Post,Category, Tag
from blogengine.views import CategoryListView, TagListView, PostsFeed

urlpatterns = patterns('',
    url(r'^$',ListView.as_view(
        model=Post,
        paginate_by=5,
    )),

    url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$',DetailView.as_view(
        model=Post,
    )),

    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$',CategoryListView.as_view(
        paginate_by = 5,
        model = Category,
    )),

    url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/?$',TagListView.as_view(
        paginate_by=5,
        model = Tag,
    )),

    url(r'^feeds/posts/?$',PostsFeed()),
)
Example #4
0
urlpatterns = [
    # Index Blog
    url(r'^(?P<page>\d+)?/?$',
     PostListView.as_view(
        paginate_by=7
        ), name = 'post_list'),       # Generic ListView

    # Individual posts
    url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$',
     DetailView.as_view()),

    # Categories
    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$',
     CategoryListView.as_view(
        paginate_by=5,
        model=Category,
        )),

    # Tags
    url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/?$',
     TagListView.as_view(
        paginate_by=5,
        model=Tag,
        )),

    # Posts RSS feed
    url(r'^feeds/posts/$', PostsFeed()),

]
Example #5
0

    # Index
    url(r'^blog/(?P<page>\d+)?/?$', ListView.as_view(
        model=Post,
        paginate_by=5,
        )),

    # Individual posts
    url(r'^blog/(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$', DetailView.as_view(
        model=Post,
        )),

    # Categories
    url(r'^blog/category/(?P<slug>[a-zA-Z0-9-]+)/?$', CategoryListView.as_view(
        paginate_by=5,
        model=Category,
        )),

    # Tags
    url(r'^blog/tag/(?P<slug>[a-zA-Z0-9-]+)/?$', TagListView.as_view(
        paginate_by=5,
        model=Tag,
        )),

	# Post RSS feed
	url(r'^blog/feeds/posts/$', PostsFeed()),

    # Archive view
    url(r'^blog/archive/$', 'blogengine.views.events_index', name='events_index'),

)
Example #6
0
    url(r'^(?P<page>\d+)?/?$',
        ListView.as_view(
            model=Post,
            paginate_by=5,
        ),
        name='index'),

    # Individual posts
    url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$',
        DetailView.as_view(model=Post, ),
        name='post'),

    # Categories
    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$',
        CategoryListView.as_view(
            model=Category,
            paginate_by=5,
        ),
        name='category'),

    # Tags
    url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/?$',
        TagListView.as_view(
            model=Tag,
            paginate_by=5,
        ),
        name='tag'),

    # Post RSS feed
    url(r'^feeds/posts/$', PostsFeed()),

    # Search posts
from django.conf.urls import patterns, url
from django.views.generic import ListView, DetailView
from blogengine.models import Category, Post, Tag
from blogengine.views import CategoryListView, TagListView, PostsFeed

urlpatterns = patterns('',
    # Index
    url(r'^(?P<page>\d+)?/?$',
        ListView.as_view(model=Post, paginate_by=5)),

    # Individual post
    url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$',
        DetailView.as_view(model=Post)),

    # Categories
    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$',
        CategoryListView.as_view(model=Category, paginate_by=5)),

    # Tags
    url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/?$',
        TagListView.as_view(model=Tag, paginate_by=5)),

    # Posts feed
    url(r'^feeds/posts/$', PostsFeed())
)
Example #8
0
from django.conf.urls import patterns, url
from django.views.generic import ListView, DetailView
from blogengine.models import Post, Category, Tag
from blogengine.views import CategoryListView, TagListView, getSearchResults

urlpatterns = patterns('',
	# Index
	url(r'^(?P<page>\d+)?/?$', ListView.as_view(model=Post, paginate_by=5), name='index'),
	# Individual posts
	url(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$', DetailView.as_view(model=Post,), name='post'),
	# Categories
	url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$', CategoryListView.as_view(paginate_by=5, model=Category,), name='category'),
	# Tags
	url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/?$', TagListView.as_view(paginate_by=5, model=Tag,), name='tag'),
	# Search
	url(r'^search', getSearchResults, name='search'),
)
Example #9
0
from django.conf.urls import url, include
from django.views.generic import ListView, DetailView
from blogengine.models import Story, Category, Tag
from blogengine.views import CategoryListView, TagListView, StoriesFeed, CategoryStoriesFeed, TagStoriesFeed
from blogengine import views

urlpatterns = [
    url(r'^story/(?P<page>\d+)?/?$', ListView.as_view(model=Story, paginate_by=2)),
    url(r'^story/(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$', DetailView.as_view(
        model=Story,
        )),
    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/(?P<page>\d+)?/?$', CategoryListView.as_view(model=Category, paginate_by=2)),
    url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/(?P<page>\d+)?/?$', TagListView.as_view(model=Tag, paginate_by=2), name='tag-view'),
    # Post RSS feed
    url(r'^feeds/stories/$', StoriesFeed()),
    # Category RSS feed
    url(r'^feeds/stories/category/(?P<slug>[a-zA-Z0-9-]+)/?$', CategoryStoriesFeed()),
    # Tag RSS feed
    url(r'^feeds/stories/tag/(?P<slug>[a-zA-Z0-9-]+)/?$', TagStoriesFeed()),
    # Search stories
    url(r'^search', views.getSearchResults),
    url(r'^story/new/$', views.createNewStory),
    url(r'^api/', include('api.urls')),
    ]
Example #10
0
urlpatterns = patterns(
    '',
    # Index
    url(r'^(?P<page>\d+)?/?$', ListView.as_view(
        model=Post,
        paginate_by=5,
    )),

    # Individual posts
    url(
        r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$',
        DetailView.as_view(model=Post, )),

    # Categories
    url(r'^category/(?P<slug>[a-zA-Z0-9-]+)/?$',
        CategoryListView.as_view(
            paginate_by=5,
            model=Category,
        )),

    # Tags
    url(r'^tag/(?P<slug>[a-zA-Z0-9-]+)/?$',
        TagListView.as_view(
            paginate_by=5,
            model=Tag,
        )),
    # Post RSS feed
    url(r'^feeds/posts/$', PostsFeed()),
)
Example #11
0
     ),

    # Index Blog - Posts List
    re_path(r'^(?P<page>\d+)?/?$',
     PostListView.as_view(
        paginate_by=7
        ), name = 'post_list'),       # Generic ListView

    # Individual posts - Post Detail
    re_path(r'^(?P<pub_date__year>\d{4})/(?P<pub_date__month>\d{1,2})/(?P<slug>[a-zA-Z0-9-]+)/?$',
     DetailView.as_view()),

    # Categories - Posts List by Category
    path(r'category/<slug:slug>/',
     CategoryListView.as_view(
        paginate_by=5,
        model=Category,
        ), name = 'category_list'),

    # Tags - Posts List by Tag
    path(r'tag/<slug:slug>/',
     TagListView.as_view(
        paginate_by=5,
        model=Tag,
        ), name = 'tag_list'),

    # Posts RSS feed
    path('feeds/posts/', PostsFeed()),

]