from __future__ import unicode_literals from django.conf.urls import patterns, url from account.views import SignupView, LoginView, LogoutView, DeleteView from account.views import ConfirmEmailView from account.views import ChangePasswordView, PasswordResetView, PasswordResetTokenView from account.views import SettingsView urlpatterns = patterns("", url(r"^signup/$", SignupView.as_view(), name="account_signup"), url(r"^login/$", LoginView.as_view(), name="account_login"), url(r"^logout/$", LogoutView.as_view(), name="account_logout"), url(r"^confirm_email/(?P<key>\w+)/$", ConfirmEmailView.as_view(), name="account_confirm_email"), url(r"^password/$", ChangePasswordView.as_view(), name="account_password"), url(r"^password/reset/$", PasswordResetView.as_view(), name="account_password_reset"), url(r"^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$", PasswordResetTokenView.as_view(), name="account_password_reset_token"), url(r"^settings/$", SettingsView.as_view(), name="account_settings"), url(r"^delete/$", DeleteView.as_view(), name="account_delete"), )
from django.views.generic import TemplateView from account.views import SignupView, LoginView, LogoutView, DeleteView from account.views import ConfirmEmailView from account.views import ChangePasswordView, PasswordResetView, \ PasswordResetTokenView from account.views import SettingsView urlpatterns = patterns( "", url(r"^signup/$", SignupView.as_view(), name="account_signup"), url(r"^login/$", LoginView.as_view(), name="account_login"), url(r"^logout/$", LogoutView.as_view(), name="account_logout"), url(r"^confirm_email/(?P<key>\w+)/$", ConfirmEmailView.as_view(), name="account_confirm_email"), url(r"^password/$", ChangePasswordView.as_view(), name="account_password"), url(r"^password/reset/$", PasswordResetView.as_view(), name="account_password_reset"), url(r"^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$", PasswordResetTokenView.as_view(), name="account_password_reset_token"), url(r"^settings/$", SettingsView.as_view(), name="account_settings"), url(r"^delete/$", DeleteView.as_view(), name="account_delete"), ) handler403 = TemplateView.as_view(template_name="403.html") handler404 = TemplateView.as_view(template_name="404.html") handler500 = TemplateView.as_view(template_name="500.html")
urlpatterns += i18n_patterns( "", url(_(r"^signup/$"), SignupView.as_view(), name="account_signup"), # original is: url(_(r"^login/$"), but we prefer: url(_(ur'^signin/$'), never_cache(LoginView.as_view()), name="signin"), # original is: url(_(r"^logout/$"), but we prefer: url(_(ur'^signout/$'), never_cache(LogoutView.as_view()), name="signout"), url(_(r"^confirm_email/(?P<key>\w+)/$"), ConfirmEmailView.as_view(), name="account_confirm_email"), url(_(r"^password/$"), ChangePasswordView.as_view(), name="account_password"), url(_(r"^password/reset/$"), PasswordResetView.as_view(), name="account_password_reset"), url(_(r"^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$"), PasswordResetTokenView.as_view(), name="account_password_reset_token"), url(_(r"^settings/$"), SettingsView.as_view(), name="account_settings"), url(_(r"^delete/$"), DeleteView.as_view(), name="account_delete"), ) # As an alternative, we could have used one indirection level, # but it's not satisfying because of the non-i18n nature of # account's URLs. # # lambda r: HttpResponseRedirect(reverse_lazy('account_login')),
from django.conf.urls.static import static from django.contrib import admin from django.views.generic import TemplateView from LMS import views urlpatterns = [ url(r"^$", TemplateView.as_view(template_name="homepage.html"), name="home"), url(r"^admin/", include([ url(r'^misc/', admin.site.urls), url(r'^', include('LMS_Admin.urls')), ])), url(r"^stu/", include("LMS_Student.urls")), url(r"^lec/", include("LMS_Teacher.urls")), url(r"^account/", include([ url(r"^signup/$", SignupView.as_view(), name="account_signup"), url(r"^login/$", views.LoginView.as_view(), name="account_login"), url(r"^logout/$", LogoutView.as_view(), name="account_logout"), url(r"^confirm_email/(?P<key>\w+)/$", ConfirmEmailView.as_view(), name="account_confirm_email"), url(r"^password/$", ChangePasswordView.as_view(), name="account_password"), url(r"^password/reset/$", PasswordResetView.as_view(), name="account_password_reset"), url(r"^password/reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$", PasswordResetTokenView.as_view(), name="account_password_reset_token"), url(r"^settings/$", SettingsView.as_view(), name="account_settings"), url(r"^delete/$", DeleteView.as_view(), name="account_delete"), ])), ] urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
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.urls import path, include from account.views import LoginView, RegisterView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView from django.conf import settings from django.conf.urls.static import static urlpatterns = [ path('jet/', include('jet.urls')), # jet URLS path('jet/dashboard', include('jet.dashboard.urls', 'jet-dashboard')), path('admin/', admin.site.urls), path('account/', include('account.urls')), path('news/', include('news.urls')), path('login/', LoginView.as_view(), name='login'), path('register/', RegisterView.as_view(), name='register'), path('password-reset/', PasswordResetView.as_view(), name='password_reset'), path('password-reset/done', PasswordResetDoneView.as_view(), name='password_reset_done'), path('reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(), name='password_reset_confirm'), path('reset/done/', PasswordResetCompleteView.as_view(), name='password_reset_complete'), ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.urls import path, include from account.views import AuthView, PasswordResetConfirmView, PasswordResetView from django.contrib.auth import views as auth_views urlpatterns = [ path('login/', AuthView.login, name="login"), path('logout/', AuthView.logout, name="logout"), # path('signup/', AuthView.signup, name="signup"), path( 'password-reset/', include([ path('', PasswordResetView.as_view( template_name='account/password_reset_form.html'), name='password_reset'), path('done/', auth_views.PasswordResetDoneView.as_view( template_name='account/password_reset_done.html'), name='password_reset_done') ])), path('reset/<str:uidb64>/<str:token>/', PasswordResetConfirmView.as_view( template_name='account/password_reset_confirm.html'), name='password_reset_confirm'), path('reset/done/', auth_views.PasswordResetCompleteView.as_view( template_name='account/password_reset_complete.html'), name='password_reset_complete') ]
from django.conf.urls import url from account.views import (CreateUserView, ChangeUserView, UserViewSet, ProfileImageUpdate, ProfileView, PasswordResetView, PasswordForgotView) from rest_framework_jwt.views import obtain_jwt_token, refresh_jwt_token from rest_framework import routers router = routers.SimpleRouter() router.register(r'user', UserViewSet) urlpatterns = [ url(r'^register/', CreateUserView.as_view()), # POST phone=phone&password=password url(r'^login/', obtain_jwt_token), url(r'^refresh/', refresh_jwt_token), url(r'^user/(?P<phone>[0-9]+)/$', ChangeUserView.as_view()), url(r'^profile/(?P<user__phone>[0-9]+)/$', ProfileView.as_view()), url(r'^profile/(?P<phone>[0-9]+)/image/$', ProfileImageUpdate.as_view()), url(r'^password_reset/$', PasswordResetView.as_view()), url(r'^forgot/$', PasswordForgotView.as_view()), ] urlpatterns += router.urls