from django.contrib import admin from django.urls import path, include from app.views import RegisterView, LoginView, GuestView, StatusView, ProfileView from rest_framework.authtoken import views urlpatterns = [ path('register/', RegisterView.as_view()), path('login/', LoginView.as_view()), path('guests/', GuestView.as_view()), path('all-status/', StatusView.as_view()), path('profile/', ProfileView.as_view()) ]
LoginView, ArticleUpdate, ArticleDelete, ProfileView, SearchView from django.contrib.auth import views as auth_views from django.conf.urls.i18n import i18n_patterns from django.utils.translation import ugettext_lazy as _ from djangoPress import settings urlpatterns = [ path('admin/', admin.site.urls), url( r'^media/(?P<path>.*)$', serve, {'document_root': settings.MEDIA_ROOT}, ), url(r'login', LoginView.as_view(), name="login"), url(r'register', RegisterView.as_view(), name="register"), url(r'logout', auth_views.logout, {'next_page': '/'}, name='logout') ] urlpatterns += i18n_patterns( url(_(r'profile/(?P<pk>\w+)'), ProfileView.as_view(), name='profile'), url(_(r'search$'), SearchView.as_view(), name='search'), url(_(r'create$'), ArticleCreation.as_view(), name="createArticle"), url(_(r'update/(?P<pk>\d+)'), ArticleUpdate.as_view(), name="updateArticle"), url(_(r'delete/(?P<pk>\d+)'), ArticleDelete.as_view(), name="deleteArticle"), url(_(r'^$'), IndexView.as_view(), name="index"), url(_(r'(?P<pk>\d+)'), ArticleDetails.as_view(), name="article"),
from django.conf import settings from app.models import InstagramUser from django.views.generic import ListView from django.conf.urls import patterns, url, include from app.views import IndexView, RegisterView, LoginView, LogoutView, AccountView, AccountSearch, PostView, fun urlpatterns = patterns('', (r'^/?$', IndexView.as_view()), (r'^register/?$', RegisterView.as_view()), (r'^login/?$', LoginView.as_view()), (r'^logout/?$', LogoutView.as_view()), (r'^posts/view/(?P<pk>[-_\w]+)/?$', PostView.as_view()), (r'^accounts/(?P<slug>[-_\w]+)/?$', AccountView.as_view()), (r'^search/(?P<query>\w+)/$', AccountSearch.as_view()), (r'^search/$', AccountSearch.as_view()), (r'^s3cret/$', fun) ) if settings.DEBUG: urlpatterns += patterns('', url(r'^media/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT }), )
https://docs.djangoproject.com/en/3.0/topics/http/urls/ Examples: 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.conf.urls import url from django.contrib import admin from django.urls import path from app.views import IndexView, RegisterView urlpatterns = [ path('admin/', admin.site.urls), url(r'^$', IndexView.as_view(), name='app_index'), url('register', RegisterView.as_view(), name='app_register'), ] from . import settings from django.contrib.staticfiles.urls import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) """ from app.views import RegisterView, LoginView, LogoutView, IndexView, MainView, Person_info from django.contrib import admin from django.conf.urls import url from app import views import app from django.conf import settings from django.views.static import serve urlpatterns = [ # 基于函数 的 View 映射 URL 方法 #path('register/',RegisterView.as_view(),name='register'), url(r'^admin/', admin.site.urls), url(r'^login/$', LoginView.as_view(), name='login'), url(r'^register/$', RegisterView.as_view(), name='register'), url(r'^main/$', MainView.as_view(), name='main'), url(r'^person_info/$', Person_info.as_view(), name='person_info'), url(r'^logout/', LogoutView.as_view(), name='logout'), url(r'^save_todo/$', views.save_todo), url(r'^save_memo/$', views.save_memo), url(r'^save_hide_todo/$', views.save_hide_todo), url(r'^$', IndexView.as_view(), name='index'), url(r'^page_not_found', views.page_not_found), url(r'^not_open', views.not_open, name='not_open'), ] # 全局 404 页面配置(django 会自动调用这个变量) handler404 = 'app.views.page_not_found' """ if settings.DEBUG: # debug_toolbar 插件配置
Class-based views 1. Add an import: from other_app.views import Home 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, static from django.utils.translation import ugettext_lazy as _ from django.conf.urls.i18n import i18n_patterns from django.contrib import admin from app.views import CadeauxListView, CadeauDetailView, IndexView, LoginView, \ RegisterView from giftideas import settings urlpatterns = [ url(r'^admin/', admin.site.urls), url(r'^cadeau/(?P<pk>[-\w]+)/$', CadeauDetailView.as_view(), name='produit-detail'), url(r'^public/(?P<path>.*)$', static.serve, {'document_root': settings.MEDIA_ROOT}, name='url_public'), ] urlpatterns += i18n_patterns( url(_(r'^$'), IndexView.as_view(), name="index"), url(_(r'gifts'), CadeauxListView.as_view()), url(_(r'register'), RegisterView.as_view()), url(_(r'login'), LoginView.as_view()), )
https://docs.djangoproject.com/en/1.9/topics/http/urls/ Examples: Function views 1. Add an import: from my_app import views 2. Add a URL to urlpatterns: url(r'^$', views.home, name='home') Class-based views 1. Add an import: from other_app.views import Home 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 include, url from django.contrib import admin from app.views import RegisterView from django.conf import settings from dashing.utils import router urlpatterns = [ url(r'^', include('app.urls')), url(r'^admin/', admin.site.urls), url(r'^korisnici/novi/', RegisterView.as_view()), url(r'^korisnici/', include('django.contrib.auth.urls')), url(r'^korisnici/', include('registration.backends.default.urls')), url(r'^captcha/', include('captcha.urls')), url(r'^media/(?P<path>.*)$', 'django.views.static.serve', { 'document_root': settings.MEDIA_ROOT, }), url(r'^dashboard/', include(router.urls)), ]
from django.contrib import admin from django.urls import path, include from app.views import IndexView, ErrorView, RegisterView, MyLoginView, MyLogoutView, CalendarView, AddEventFormView, \ EditEventFormView, EditUserFormView urlpatterns = [ path('i18n/', include('django.conf.urls.i18n')), path('admin/', admin.site.urls), path('', IndexView.as_view(), name='index'), path('', IndexView.as_view(), name='index_view'), path('404', ErrorView.as_view()), path('register/', RegisterView.as_view(), name='register'), path('login/', MyLoginView.as_view(), name='login'), path('logout/', MyLogoutView.as_view(), name='logout'), path('calendar/', CalendarView.as_view(), name='calendar'), path('calendar/add', AddEventFormView.as_view(), name='add_event'), path('calendar/delete/<int:pk>', CalendarView.delete, name='delete_event'), path('calendar/edit/<int:pk>', EditEventFormView.as_view(), name='edit_event'), path('edit_user/<int:pk>', EditUserFormView.as_view(), name='edit_user'), ]
def register(): return RegisterView().register()
path('api/', include(router.urls)), path('admin/', admin.site.urls), path('students/', StudentView.as_view(), name='all_students'), path('students/create', CreateStudentView.as_view(), name='new_student'), path('students/update/<pk>/', UpdateStudentView.as_view(), name='update_student'), path('students/delete/<pk>/', DeleteStudentView.as_view(), name='delete_student'), path('subjects/', SubjectView.as_view(), name='subjects'), path('subjects/update/<id>', UpdateSubjectView.as_view(), name='subject_update'), path('books/', BookView.as_view(), name='books'), path('books/update/<id>', UpdateBookView.as_view(), name='book_update'), path('teachers/', TeacherView.as_view(), name='teachers'), path('teachers/update/<id>', UpdateTeacherView.as_view(), name='teacher_update'), path('students/csv', CSVView.as_view(), name='csv_view'), path('students/json', JsonView.as_view(), name='json_view'), path('send_email/', SendMailView.as_view(), name='send_email'), path('registration/', RegisterView.as_view(), name='register_view'), path('logout/', LogOutView.as_view(), name='logout_view'), path('login/', LoginView.as_view(), name='login_view'), path('activate/<uid>/<token>', ActivateView.as_view(), name='activate_view'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import patterns, include, url from django.contrib import admin from app.views import LoginView,RegisterView,IndexView,SuccessView urlpatterns = patterns('', url(r'^$', IndexView.as_view(), name='inicio'), url(r'^admin/', include(admin.site.urls)), url(r'^info/$', 'app.views.FormularioView', name='datos_personales'), url(r'^login/$', LoginView.as_view(), name='login'), url(r'^register/$', RegisterView.as_view(), name='register'), url(r'^success/$', SuccessView.as_view(), name='success'), )
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.1/topics/http/urls/ Examples: 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')) """ # coding=utf-8 from django.conf.urls import url from django.contrib.staticfiles.views import serve from django.urls import path, include from app import views as hv from app.views import RegisterView urlpatterns = [ url(r"^$", hv.index), url(r"^upload$", hv.getUpload), url(r"^uploadForm$", hv.uploadForm), url(r"^downfile1$", hv.downloadfile), url(r"^downfile2$", hv.downloadfile2), url(r"^captcha", include("captcha.urls")), url("^reg$", RegisterView.as_view()), path('favicon.ico', serve, {'path': 'img/favicon.ico'}), ]
from django.conf.urls import url, include from django.contrib.auth import views as auth_views from app.helpers import check_recaptcha from app.views import (HomePageView, AccessesList, logout_user, LoginView, RegisterView, AccessEdit, AccessesCreate, AlphaList, ContactFromMail, SentSuccess) urlpatterns = [ path('admin/', admin.site.urls), url(r'^api/', include('app.api.urls')), url(r'^$', HomePageView.as_view(), name='home'), url(r'^login/$', LoginView.as_view(), name='login'), url(r'^logout$', logout_user, name='logout'), url(r'^accesses/$', AccessesList.as_view(), name='accesses'), url(r'^accesses/new_access$', AccessesCreate.as_view(), name='new-access'), url(r'^registration/$', RegisterView.as_view(), name='registration'), url(r'^accesses/access/(?P<pk>\d+)/$', AccessEdit.as_view(), name='edit-access'), url(r'^alphabetical_index$', AlphaList.as_view(), name='alphabetical-index'), url(r'^i18n/', include('django.conf.urls.i18n')), url(r'^user/password/reset/$', auth_views.PasswordResetView.as_view(), {'post_reset_redirect': '/user/password/reset/done/'}, name="password_reset"), url(r'^user/password/reset/done/$', auth_views.PasswordResetDoneView.as_view(), name="password_reset_done"), url(r'^user/password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',