from accounts.views import SignUp from django.urls import path urlpatterns = [ path('create_account', SignUp.as_view()), ]
The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/2.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.contrib import admin from django.contrib.auth.views import login, logout from django.urls import path, include from accounts.views import SignUp from django.conf.urls.static import static from django.contrib.staticfiles.urls import staticfiles_urlpatterns from . import settings urlpatterns = [ path('admin/', admin.site.urls), path('', include('recipeblog.urls')), path('accounts/signup', SignUp.as_view(), name='signup'), path('accounts/login', login, name='login'), path('accounts/logout', logout, name='logout'), ] urlpatterns += staticfiles_urlpatterns() urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from accounts.views import SignUp from django.urls import path from django.contrib.auth import views as auth_views app_name = 'accounts' urlpatterns = [ path('login/', auth_views.LoginView.as_view(template_name="accounts/login.html"),name='login'), path('logout/', auth_views.LogoutView.as_view(), name="logout"), path('signup/', SignUp.as_view(), name="signup"), ]
from django.urls import path from django.contrib.auth.views import LogoutView from accounts.views import LoginView, SignUp, UserDetailView, UserUpdateView, UserDeleteView, UserPasswordChangeView, \ UserListView, UserSearchView, SearchResultsView, BanChangeView app_name = 'accounts' urlpatterns = [ path('login/', LoginView.as_view(), name='login'), path('logout/', LogoutView.as_view(), name='logout'), path('create/', SignUp.as_view(), name='create'), path('profile/<int:pk>/', UserDetailView.as_view(), name='user_detail'), path('profile/<int:pk>/update/', UserUpdateView.as_view(), name='user_update'), path('profile/<int:pk>/delete/', UserDeleteView.as_view(), name='user_delete'), path('profile/<int:pk>/change_password/', UserPasswordChangeView.as_view(), name='user_change_password'), path('profile/list/', UserListView.as_view(), name='user_list'), path('user/search/', UserSearchView.as_view(), name='user_search'), path('user/search/results/', SearchResultsView.as_view(), name='search_results'), path('users/change_ban/<int:pk>/', BanChangeView.as_view(), name="ban_change"), ]
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.urls import path, include from django.conf.urls.static import static from django.conf import settings from accounts.views import SignUp, LoginIn, SignOutView, SuccessToken urlpatterns = [ path('admin/', admin.site.urls), path('', include('room.urls')), path('api/', include('api.urls')), path('profile', include('accounts.urls')), path(r'signup/', SignUp.as_view(), name='signup'), path(r'login/', LoginIn.as_view(), name='login'), path(r'logout/', SignOutView.as_view(), name='logout'), path(r'success/', SuccessToken.as_view(), name='success'), ] if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_URL) urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
from django.conf.urls import url from accounts.views import SignUp from django.contrib.auth import views as v app_name = 'accounts' urlpatterns = [ url(r'^signup/$', SignUp.as_view(), name='signup'), url(r'^login/$', v.LoginView.as_view(), name='login'), url(r'^logout/$', v.LogoutView.as_view(), name='logout'), ]
from django.conf import settings from django.conf.urls.static import static from django.contrib import admin from django.urls import path, include from accounts.views import SignUp urlpatterns = [ path('', include('tweets.urls')), path('profile/', include('profiles.urls')), path('api/profiles/', include('profiles.api.urls')), path('api/tweets/', include('tweets.api.urls')), path('register/', SignUp.as_view(), name='signup'), path('', include('django.contrib.auth.urls')), path('admin/', admin.site.urls), ] # should not be used in real production urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
from experimentor.views import (index, experiment_view, new_experiment, new_signal, signal_view, experiments_view, ExperimentView) from accounts.views import (AccountView, SignUp, SignUpSuccess, LoginView, profile_view, activate) from api.urls import urlpatterns urlpatterns = [ path('admin/', admin.site.urls), path('', index, name='home'), path('login', LoginView.as_view(template_name='login.html'), name='login'), path('logout', LogoutView.as_view(), name='logout'), path('signup', SignUp.as_view(), name='signup'), path('signup/successful', SignUpSuccess.as_view(), name='signup_success'), path('reset', PasswordResetView.as_view( template_name='account/password_reset.html', email_template_name='account/password_reset_email.html', subject_template_name='account/password_reset_subject.txt'), name='password_reset'), path('reset/done', PasswordResetDoneView.as_view( template_name='account/password_reset_done.html'), name='password_reset_done'), path('reset/<uidb64>/<token>', PasswordResetConfirmView.as_view( template_name='account/password_reset_confirm.html'), name='password_reset_confirm'),
from django.urls import path from accounts.views import SignUp urlpatterns = [ path('signup/', SignUp.as_view()) ]
# -*- coding: utf-8 -*- __author__ = 'akiokio' from django.conf.urls import url from accounts.views import SignUp, SignUpSocial urlpatterns = [ url(r'signup/social/$', SignUpSocial.as_view(), name="sign_up_social"), url(r'signup/$', SignUp.as_view(), name="sign_up"), ]