from django.conf.urls import patterns from django.conf.urls import url from blogengine.views import PostListView, PostCreate __author__ = 'juanwolf' urlpatterns = patterns( '', url(r'^$', PostListView.as_view(), name='homepage'), url(r'^post/create', PostCreate.as_view(), name='create-post'))
from django.conf.urls import patterns from django.conf.urls import url from blogengine.views import PostListView, PostCreate __author__ = 'juanwolf' urlpatterns = patterns('', url(r'^$', PostListView.as_view(), name='homepage'), url(r'^post/create', PostCreate.as_view(), name='create-post') )
from django.conf.urls import patterns, url from blogengine.models import Post, Category, Tag from blogengine.views import PostListView, DetailView, CategoryListView, TagListView, PostsFeed 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
from blogengine.views import PostCreateView, PostListView, DetailView, CategoryListView, TagListView, PostsFeed from django.contrib.auth.decorators import login_required, permission_required urlpatterns = [ # Blog Create Post Form path('create/', login_required(PostCreateView.as_view()), name = 'create_post' # added login_required but need settings.LOGIN_URL for user friendlines ), # 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>/',