Beispiel #1
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"),
]
Beispiel #2
0
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
#from django_registration.backends.activation import urls
from django.urls import path, include
from django.contrib.auth.decorators import login_required as auth
from django.contrib.auth.views import LoginView, logout_then_login
from links.views import LinkListView, UserProfileDetailView, UserProfileEditView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', LinkListView.as_view(), name='home'),
    path('login/',
         LoginView.as_view(template_name="links/login.html"),
         name='login'),
    path('logout/', logout_then_login, name='logout'),
    path('accounts/', include('django_registration.backends.one_step.urls')),
    path('users/<slug>/', UserProfileDetailView.as_view(), name="profile"),
    path('edit_profile/',
         auth(UserProfileEditView.as_view()),
         name="edit_profile"),
]
Beispiel #3
0
from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required as auth
from django.contrib import admin
admin.autodiscover()

from links.views import LinkListView
from links.views import UserProfileDetailView
from links.views import UserProfileEditView

urlpatterns = patterns('',
    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")
)
Beispiel #4
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"),
]
Beispiel #5
0
    2. Add a URL to urlpatterns:  url(r'^$', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.conf.urls import url, include
    2. Add a URL to urlpatterns:  url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
from django.contrib import admin
from django.contrib.auth import views as auth_views
from links.views import LinkListView
from links.views import UserProfileDetailView
from django.contrib.auth.decorators import login_required as auth # Keep non-users out
from links.views import UserProfileEditView
from links.views import LinkCreateView, LinkDetailView
from links.views import LinkEditView
from links.views import LinkDeleteView

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^$', LinkListView.as_view(), name='home'),
    url(r'^login/$', auth_views.login, name='login'),
    url(r'^logout/$', auth_views.logout, 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/submit/$', auth(LinkCreateView.as_view()), name='link_submit'),
    url(r'^link/(?P<pk>\d+)/$', LinkDetailView.as_view(), name='link_detail'),
    url(r'^link/edit/(?P<pk>\d+)/$', auth(LinkEditView.as_view()), name='link_edit'),
    url(r'^link/delete/(?P<pk>\d+)/$', auth(LinkDeleteView.as_view()), name='link_delete'),
    url(r'^comments/', include('django_comments.urls')),
]
Beispiel #6
0
	url(r'^calculator/$', auth(calculator), name='calculator'),
	url(r'^whook/$', webhook_event, name='webhook_event'),
	#########################################Logging out############################################
	url(r'^are_you_sure/$', auth(logout_rules), name="bahirniklo"),
	url(r'^logout_penalty/$', LogoutPenaltyView.as_view(), name='logout_penalty'),
	url(r'^click_ad/(?P<ad_id>\d+)/', auth(click_ad),name='click_ad'),
	################################################################################################
	url(r'^logout_help/$', LogoutHelpView.as_view(), name='logout_help'),
	url(r'', include('user_sessions.urls', 'user_sessions')),
	url(r'^user/(?P<nick>[\w.@+-]+)/shared-fotos/$', show_shared_photo_metrics, name='show_shared_photo_metrics'),
	url(r'^user/(?P<slug>[\w.@+-]+)/(?P<type>[\w.@+-]+)/$', UserProfilePhotosView.as_view(), name='profile'),
	# url(r'^user/(?P<slug>.+)/$', missing_page, name='profile'), #captures any kind of slug - for errors
	url(r'^usrp/(?P<slug>[\w.@+-]+)/(?P<key>\d+)/$', profile_pk, name='profile_pk'),
	url(r'^user_prof/(?P<slug>[\w.@+-]+)/(?P<photo_pk>\d+)/$', user_profile_photo, name='user_profile_photo'),
	url(r'^user_prof/(?P<slug>[\w.@+-]+)/(?P<photo_pk>\d+)/(?P<is_notif>\d+)/$', user_profile_photo, name='user_profile_photo'),
	url(r'^users/(?P<slug>[\w.@+-]+)/$', UserProfileDetailView.as_view(), name='user_profile'),
	url(r'^edit_settings/$', auth(UserSettingsEditView.as_view()), name='edit_settings'),
	url(r'^edit_profile/$', auth(UserProfileEditView.as_view()), name='edit_profile'),
	url(r'^unseen_fans/$', auth(unseen_fans), name='unseen_fans'),
	url(r'^api/ad/live/$', process_req, name='process_req'),
	url(r'^api/ad/suspend/$', suspend_req, name='suspend_req'),
	url(r'^api/ad/delete/$', delete_req, name='delete_req'),
	url(r'^api/ad/resume/$', resume_req, name='resume_req'),
	url(r'^make_ad/$', make_ad, name='make_ad'),
	url(r'^ad_finalize/$', ad_finalize, name='ad_finalize'),
	url(r'^missing/$', missing_page, name='missing_page'),
	url(r'^error/$', error, name='error'),
	url(r'^ad_description/$', AdDescriptionView.as_view(), name='ad_description'),
	url(r'^ad_mobile_num/$', AdMobileNumView.as_view(), name='ad_mobile_num'),
	url(r'^ad_title/$', AdTitleView.as_view(), name='ad_title'),
	url(r'^ad_call_pref/$', AdCallPrefView.as_view(), name='ad_call_pref'),