Esempio n. 1
0
from accounts.views import UserRegistrationView
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from blog.views import NewBlogView
from blog.views import HomeView, UpdateBlogView, NewBlogPostView, UpdateBlogPostView, BlogPostDetailsView, SharePostWithBlog
from blog.views import StopSharingPostWithBlog, ShareBlogPostView

urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^new-user/$',
        UserRegistrationView.as_view(),
        name='user_registration'),
    url(r'^login/$', login, {'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, {'next_page': '/login/'}, name='logout'),
    url(r'^blog/new/$', NewBlogView.as_view(), name='new-blog'),
    url(r'^blog/(?P<pk>\d+)/update/$',
        UpdateBlogView.as_view(),
        name='update-blog'),
    url(r'blog/post/new/$', NewBlogPostView.as_view(), name='new-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/update/$',
        UpdateBlogPostView.as_view(),
        name='update-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/$',
        BlogPostDetailsView.as_view(),
        name='blog-post-details'),
    url(r'blog/post/(?P<pk>\d+)/share/$',
        ShareBlogPostView.as_view(),
        name='share-blog-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/share/to/(?P<blog_pk>\d+)/$',
        SharePostWithBlog.as_view(),
Esempio n. 2
0
from accounts.views import UserRegistrationView
from django.contrib.auth.views import LoginView, LogoutView
from blog.views import NewBlogView, BlogPostDetailsView, UpdateBlogPostView, ShareBlogPostView, ShareBlogPostView, ShareBlogPostView, SharePostWithBlog, StopSharingPostWithBlog

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', TemplateView.as_view(template_name='base.html'), name='home'),
    path('new_user/', UserRegistrationView.as_view(),
         name='user_registration'),
    path("login/",
         LoginView.as_view(), {'template_name': 'login.html'},
         name="login"),
    path("logout/",
         LogoutView.as_view(), {'next_page': '/login/'},
         name="logout"),
    path("blog/new/", NewBlogView.as_view(), name="new-blog"),
    path('blog/post/', BlogPostDetailsView.as_view(),
         name="blog-post-details"),
    url(r'blog/post/(?P<pk>\d+)/update/$',
        UpdateBlogPostView.as_view(),
        name='update-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/$',
        BlogPostDetailsView.as_view(),
        name='blog-post-details'),
    url(r'blog/post/(?P<pk>\d+)/share/$',
        ShareBlogPostView.as_view(),
        name='share-blog-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/share/to/(?P<blog_pk>\d+)/$',
        SharePostWithBlog.as_view(),
        name='share-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/stop/share/to/(?P<blog_pk>\d+)/$',
Esempio n. 3
0
from accounts.views import UserRegistrationView
from django.contrib.auth.views import LoginView, LogoutView
from blog.views import NewBlogView, UpdateBlogView, NewBlogPostView, UpdateBlogPostView, BlogPostDetailsView, SharePostWithBlog, StopSharingPostWithBlog

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', TemplateView.as_view(template_name='base.html'), name='home'),
    path('new-user/', UserRegistrationView.as_view(),
         name='user_registration'),
    path('login/',
         LoginView.as_view(), {'template_name': 'login.>html'},
         name='login'),
    path('logout/',
         LogoutView.as_view(), {'next_page': '/login/'},
         name='logout'),
    path('blog/new/', NewBlogView.as_view(), name='new-blog'),
    path('blog/<int:pk>/update/', UpdateBlogView.as_view(),
         name='update-blog'),
    path('blog/post/new/', NewBlogPostView.as_view(), name='new-blog-post'),
    path('blog/post/<int:pk>/update/',
         UpdateBlogPostView.as_view(),
         name='update-blog-post'),
    path('blog/post/<int:pk>/',
         BlogPostDetailsView.as_view(),
         name='blog-post-details'),
    path('blog/post/<int:pk>/share/',
         SharePostWithBlog.as_view(),
         name='share-blog-post-with-blog'),
    path('blog/post/<int:pk>/share/to/<int:blog_pk>/',
         SharePostWithBlog.as_view(),
         name='share-post-with-blog'),
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from accounts.views import UserRegistrationView
from blog.views import NewBlogView
from blog.views import HomeView
from blog.views import UpdateBlogView
from blog.views import NewBlogPostView
from blog.views import UpdateBlogPostView
from blog.views import BlogPostDetailsView
from blog.views import SharePostWithBlog
from blog.views import StopSharingPostWithBlog
from blog.views import ShareBlogPostView


urlpatterns = [
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^new-user/$', UserRegistrationView.as_view(), name='user_registration'),
    url(r'^login/$', login, {'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, {'next_page': '/login/'}, name='logout'),

    url(r'^blog/new/$', NewBlogView.as_view(), name='new-blog'),
    url(r'^blog/(?P<pk>\d+)/update/$', UpdateBlogView.as_view(), name='update-blog'),
    url(r'blog/post/new/$', NewBlogPostView.as_view(), name='new-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/update/$', UpdateBlogPostView.as_view(), name='update-blog-post'),
    url(r'blog/post/(?P<pk>\d+)/$', BlogPostDetailsView.as_view(), name='blog-post-details'),
    url(r'blog/post/(?P<pk>\d+)/share/$', ShareBlogPostView.as_view(), name='share-blog-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/share/to/(?P<blog_pk>\d+)/$', SharePostWithBlog.as_view(), name='share-post-with-blog'),
    url(r'blog/post/(?P<post_pk>\d+)/stop/share/to/(?P<blog_pk>\d+)/$', StopSharingPostWithBlog.as_view(), name='stop-sharing-post-with-blog'),
]