SubmissionDetailView,
    NewCommentView,
    NewCommentReplyView,
    UpvoteSubmissionView,
    RemoveUpvoteSubmissionView,
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', HomeView.as_view(), name='home'),
    path('login/', LoginView.as_view(template_name='login.html'),
         name='login'),
    path('logout/', LogoutView.as_view(next_page='/login/'), name='logout'),
    path('register/', UserRegistrationView.as_view(),
         name='user-registration'),
    path('new-submission/', NewSubmissionView.as_view(),
         name='new-submission'),
    path('submission/<int:pk>/',
         SubmissionDetailView.as_view(),
         name='submission-detail'),
    path('new-comment/', NewCommentView.as_view(), name='new-comment'),
    path('new-comment-reply/',
         NewCommentReplyView.as_view(),
         name='new-comment-reply'),
    path('upvote/<int:pk>/',
         UpvoteSubmissionView.as_view(),
         name='upvote-submission'),
    path('upvote/<int:pk>/remove/',
         RemoveUpvoteSubmissionView.as_view(),
         name='remove-upvote'),
]
Exemplo n.º 2
0
from links.views import UpvoteSubmissionView
from links.views import RemoveUpvoteFromSubmissionView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', HomeView.as_view(), name='home'),
    url(r'^login/$',
        login,
        kwargs={'template_name': 'login.html'},
        name='login'),
    url(r'^logout/$', logout, kwargs={'next_page': '/login/'}, name='logout'),
    url(r'^register/$',
        UserRegistrationView.as_view(),
        name='user-registration'),
    url(r'^new-submission/$',
        NewSubmissionView.as_view(),
        name='new-submission'),
    url(r'^submission/(?P<pk>\d+)/$',
        SubmissionDetailView.as_view(),
        name='submission-detail'),
    url(r'new-comment/$', NewCommentView.as_view(), name='new-comment'),
    url(r'new-comment-reply/$',
        NewCommentReplyView.as_view(),
        name='new-comment-reply'),
    url(r'^upvote/(?P<link_pk>\d+)/$',
        UpvoteSubmissionView.as_view(),
        name='upvote-submission'),
    url(r'^upvote/(?P<link_pk>\d+)/remove/$',
        RemoveUpvoteFromSubmissionView.as_view(),
        name='remove-upvote'),
]
from django.contrib.auth.views import login
from django.contrib.auth.views import logout
from django.views.generic import TemplateView

from accounts.views import UserRegistrationView
from links.views import HomeView
from links.views import NewSubmissionView
from links.views import SubmissionDetailView
from links.views import NewCommentView
from links.views import NewCommentReplyView
from links.views import UpvoteSubmissionView
from links.views import RemoveUpvoteFromSubmissionView


urlpatterns = [
    url(r'^admin/', admin.site.urls),

    url(r'^$', HomeView.as_view(), name='home'),

    url(r'^login/$', login, kwargs={'template_name': 'login.html'}, name='login'),
    url(r'^logout/$', logout, kwargs={'next_page': '/login/'}, name='logout'),
    url(r'^register/$', UserRegistrationView.as_view(), name='user-registration'),

    url(r'^new-submission/$', NewSubmissionView.as_view(), name='new-submission'),
    url(r'^submission/(?P<pk>\d+)/$', SubmissionDetailView.as_view(), name='submission-detail'),
    url(r'new-comment/$', NewCommentView.as_view(), name='new-comment'),
    url(r'new-comment-reply/$', NewCommentReplyView.as_view(), name='new-comment-reply'),

    url(r'^upvote/(?P<link_pk>\d+)/$', UpvoteSubmissionView.as_view(), name='upvote-submission'),
    url(r'^upvote/(?P<link_pk>\d+)/remove/$', RemoveUpvoteFromSubmissionView.as_view(), name='remove-upvote'),
]