Ejemplo n.º 1
0
         ProfileSentView.as_view(),
         name='profile_sent'),
    path('accounts/profile/<username>/voted',
         ProfileVotedView.as_view(),
         name='profile_voted'),
    path('accounts/profile/<username>/comments',
         ProfileCommentsView.as_view(),
         name='profile_comments'),

    # links app
    path('', LinkListView.as_view(), name='link_list'),
    path('latest/', LinkLatestView.as_view(), name='link_latest'),
    path('top/', LinkTopView.as_view(), name='link_top'),
    path('create/', LinkCreateView.as_view(), name='link_create'),
    path('detail/<pk>', LinkDetailView.as_view(), name='link_detail'),
    path('update/<pk>', LinkUpdateView.as_view(), name='link_update'),
    path('delete/<pk>', LinkDeleteView.as_view(), name='link_delete'),

    # voting app
    path('vote/<pk>', VoteView.as_view(), name='vote'),

    # comments app
    path('detail/<pk>/comment',
         CommentCreateView.as_view(),
         name='comment_create'),
    path('detail/<id>/comment/delete/<pk>',
         CommentDeleteView.as_view(),
         name='comment_delete'),
    path('detail/comment/point/<pk>/', PointView.as_view(), name='point'),
]
Ejemplo n.º 2
0
urlpatterns = [
    url(r'^$', redirect_root),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^comments/', include('django_comments.urls')),
    url(r'^home/$', LinkListView.as_view(), name='home'),
    url(r'^pages/', include('django.contrib.flatpages.urls')),
    url(r'^contact/', include(contact_urls)),
    url(r'^login/$',
        "django.contrib.auth.views.login", {"template_name": "login.html"},
        name="login"),
    url(r'^logout/$',
        "django.contrib.auth.views.logout_then_login",
        name="logout"),
    url(r'^accounts/', include("registration.backends.simple.urls")),
    url(r"^users/(?P<slug>\w+)/$",
        UserProfileDetailView.as_view(),
        name="profile"),
    url(r"edit_profile/$",
        auth(UserProfileEditView.as_view()),
        name="edit_profile"),
    url(r"^link/create/$", auth(LinkCreateView.as_view()), name="link_create"),
    url(r"^link/(?P<pk>\d+)$", LinkDetailView.as_view(), name="link_detail"),
    url(r"^link/update/(?P<pk>\d+)$",
        auth(LinkUpdateView.as_view()),
        name="link_update"),
    url(r"^link/delete/(?P<pk>\d+)$",
        auth(LinkDeleteView.as_view()),
        name="link_delete"),
    url(r'^vote/$', auth(VoteFormView.as_view()), name="vote"),
]
Ejemplo n.º 3
0
from django.conf.urls import include, url
from django.contrib import admin
from links.views import LinkListView
from links.views import UserProfileDetailView
from django.contrib.auth.decorators import login_required as auth
from links.views import UserProfileEditView
from links.views import LinkCreateView
from links.views import LinkDetailView
from links.views import LinkUpdateView
from links.views import LinkDeleteView
from links.views import VoteFormView

urlpatterns = [
    url(r'^static/(?P<path>.*)$','django.views.static.serve',{'document_root': 'static'}),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^$', LinkListView.as_view(), name='home'),
    url(r'^login/$', 'django.contrib.auth.views.login', {
    'template_name': 'login.html'}, name="login"),
    url(r'^logout/$', 'django.contrib.auth.views.logout_then_login',
        name="logout"),
    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^users/(?P<slug>\w+)/$', UserProfileDetailView.as_view(), name="profile"),
    url(r'^edit_profile/$', auth(UserProfileEditView.as_view()), name="edit_profile"),
    url(r'^link/create/$', auth(LinkCreateView.as_view()),name='link_create'),
    url(r'^link/(?P<pk>\d+)/$', LinkDetailView.as_view(), name='link_detail'),
    url(r'^link/update/(?P<pk>\d+)/$', auth(LinkUpdateView.as_view()), name='link_update'),
    url(r'^link/delete/(?P<pk>\d+)/$', auth(LinkDeleteView.as_view()), name='link_delete'),
    url(r'^comments/', include('django_comments.urls')),
    url(r'^vote/$', auth(VoteFormView.as_view()), name="vote"),
]
Ejemplo n.º 4
0
urlpatterns = patterns('',

    url(r'^admin/', include(admin.site.urls)),
    url(r'^comments/', include("django.contrib.comments.urls")),
    url(r'^$',LinkListView.as_view(), name='home'),
    
    url(r"^login/$", "django.contrib.auth.views.login",
        {"template_name": "login.html"}, name="login"),
    url(r"^logout/$", "django.contrib.auth.views.logout_then_login",
        name="logout"),
        
    url(r"^accounts/", include("registration.backends.simple.urls")),
    url(r"^users/(?P<slug>\w+)/$", UserProfileDetailView.as_view(), 
        name="profile"),
    url(r"edit_profile/$", UserProfileEditView.as_view(),
        name="edit_profile"),
        
    url(r"^link/create/$", auth(LinkCreateView.as_view()),
        name="link_create"),
    
    url(r"^link/(?P<pk>\d+)$", LinkDetailView.as_view(),
        name="link_detail"),
        
    url(r"^link/update/(?P<pk>\d+)$", auth(LinkUpdateView.as_view()),
        name="link_update"),
        
    url(r"^link/delete/(?P<pk>\d+)$", auth(LinkDeleteView.as_view()),
        name="link_delete"),
)
Ejemplo n.º 5
0
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required

from django.urls import include, path

from links import views as linkviews

from links.views import LinkDetailView, LinkUpdateView, LinkDeleteView

# (P<pk>\d+) used to get primary key of link
urlpatterns = [
    path('login/', auth_views.login, name='login'),
    path('logout/', auth_views.logout, name='logout'),
    path('signup/', linkviews.signup, name='signup'),
    path('admin/', admin.site.urls),
    path('links/create/',
         login_required(linkviews.link_create),
         name='link_create'),
    path('link/(P<pk>\d+)/', LinkDetailView.as_view(), name='link_detail'),
    path('links/delete/(P<pk>\d+)',
         login_required(LinkDeleteView.as_view()),
         name='link_delete'),
    path('links/update/(P<pk>\d+)/',
         login_required(LinkUpdateView.as_view()),
         name='link_update'),
    path('comment/(P<pk>\d+)', linkviews.link_comment, name='link_comment'),
    path('reply/(P<pk>\d+)', linkviews.reply_comment, name='reply_comment'),
    path('vote/', login_required(linkviews.updoot), name='vote'),
    path('', include('links.urls'))
]
Ejemplo n.º 6
0


urlpatterns = patterns('',
    # Examples:
    # url(r'^$', 'gogoreader.views.home', name='home'),
    # url(r'^gogoreader/', include('gogoreader.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
    url(r'^comments', include("django.contrib.comments.urls")),
    url(r'^$', show_profile, name='home'),
    url(r'^post', post_data, name='post_data'),

    url(r'^login/$', 'django.contrib.auth.views.login', {'template_name': 'login.html'}, name="login"),
    url(r'^logout/$', 'django.contrib.auth.views.logout_then_login',name="logout"),
    url(r'^accounts/', include('registration.backends.simple.urls')),
    url(r'^users/(?P<slug>\w+)/$', UserProfileDetailView.as_view(), name="profile"),
    url(r'edit_profile/$', auth(UserProfileEditView.as_view()), name='edit_profile'),
    url(r'^link/create/$', auth(LinkCreateView.as_view()), name='link_create'),
    url(r'^rss/create/$', auth(RssCreateView.as_view()), name='rss_create'),
    url(r'^link/update/(?P<pk>\d+)/$', auth(LinkUpdateView.as_view()), name='link_update'),
    url(r'^link/delete/(?P<pk>\d+)/$', auth(LinkDeleteView.as_view()), name='link_delete'),
    url(r'^link/(?P<pk>\d+)$', LinkDetailView.as_view(), name='link_detail'),
    url(r'^tag/(?P<pk>\d+)$', show_tag_links, name='link_tag'),

)
Ejemplo n.º 7
0
from django.conf.urls.defaults import patterns, include, url
from links.views import LinkListView, LinkCreateView, LinkUpdateView
from django.contrib.auth.decorators import user_passes_test
urlpatterns = patterns('',
	url(r'^$', LinkListView.as_view(), name='link-list-view'),
 	url(r'^add/$',user_passes_test(lambda u:u.is_staff)(LinkCreateView.as_view())),
 	url(r'^modify/(?P<pk>\d+)/$', user_passes_test(lambda u:u.is_staff)(LinkUpdateView.as_view())),									
	)
Ejemplo n.º 8
0
from django.conf.urls import patterns, include, url
from links.views import LinkListView, LinkCreateView, LinkUpdateView
from django.contrib.auth.decorators import permission_required

urlpatterns = patterns('',
	url(r'^$', LinkListView.as_view(), name='link_view'),
 	url(r'^add/$',permission_required('classlists.is_kksastaff', login_url='/registration/login/')(LinkCreateView.as_view())),
 	url(r'^modify/(?P<pk>\d+)/$', permission_required('classlists.is_kksastaff', login_url='/registration/login/')(LinkUpdateView.as_view())),									
	)