本文整理汇总了Python中users.views.LoginView类的典型用法代码示例。如果您正苦于以下问题:Python LoginView类的具体用法?Python LoginView怎么用?Python LoginView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了LoginView类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: patterns
from django.conf.urls import include, url,patterns
from django.contrib import admin
from users.views import RegisterView,LoginView, LogoutView, UserProfileView, GameView
from django.views.generic import View
from django.views.decorators.csrf import csrf_exempt
urlpatterns = patterns('',
url(r'^$', GameView.as_view()),
url(r'^login/$', csrf_exempt(LoginView.as_view())),
url(r'^register/$', csrf_exempt(RegisterView.as_view())),
url(r'^logout/$', csrf_exempt(LogoutView.as_view())),
url(r'^profile/$', csrf_exempt(UserProfileView.as_view())),
# url(r'^search$', SearchView.as_view()),
#
# url(r'^post$', PostView.as_view()),
#
# url(r'^repost$', RepostView.as_view()),
)
示例2: DefaultRouter
"""
from django.conf.urls import url, include
from django.contrib import admin
from rest_framework.routers import DefaultRouter
from blogs.views import lastest_posts, blogs_list, blog_detail, post_detail, NewPostView
from users.views import LoginView, SignUpView, LogoutView
from users.api import UserViewSet
from blogs.api import BlogViewSet, PostViewSet
router = DefaultRouter()
router.register("users", UserViewSet, base_name="users_api")
router.register("blogs", BlogViewSet, base_name="blogs_api")
router.register("posts", PostViewSet, base_name="posts_api")
router.register(r'blogs/(?P<blog_id>[0-9]+)/posts', PostViewSet)
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^$', lastest_posts, name="index"),
url(r'^blogs/?$', blogs_list, name="blog_list"),
url(r'^blogs/(?P<slug>[\[email protected]+-]+)/?$', blog_detail, name="blog_detail"),
url(r'^blogs/(?P<slug>[\[email protected]+-]+)/(?P<post_pk>[0-9]+)/?$', post_detail, name="post_detail"),
url(r'^new_post', NewPostView.as_view(), name="new_post"),
url(r'^login',LoginView.as_view(), name="login"),
url(r'^logout',LogoutView.as_view(), name="logout"),
url(r'^signup',SignUpView.as_view(), name="signup"),
#api
url(r'^api/1.0/', include(router.urls)),
]
示例3: url
from django.conf.urls import url
from ui.views import IndexView
from users.views import LoginView, LogoutView
from wins.views import NewWinView, ThanksView, ConfirmationView
urlpatterns = [
url(r"^wins/new/", NewWinView.as_view(), name="new"),
url(r"^wins/thanks/", ThanksView.as_view(), name="thanks"),
url(
r"^wins/review/(?P<pk>[a-z0-9\-]+)/",
ConfirmationView.as_view(),
name="responses"
),
url(r'^accounts/login/', LoginView.as_view(), name="login"),
url(r"^accounts/logout/", LogoutView.as_view(), name="logout"),
url(r"^$", IndexView.as_view(), name="index"),
]
示例4: url
from users.views import SendTrainerMessageView
from users.views import IndexView
from users.views import TrainerLoginView
from users.views import TrainerDashboardView
from users.views import SendClientMessageView
from users.views import GetUserChatView
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^trainers/login/$', TrainerLoginView.as_view(), name='trainer-login-view'),
url(r'^trainers/dashboard/$', TrainerDashboardView.as_view(), name='trainer-dashboard-view'),
url(r'^trainers/send-client-message/$', SendClientMessageView.as_view(), name="send-client-message"),
url(r'^trainers/get-user-chat/$', GetUserChatView.as_view(), name='get-user-chat-view'),
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^users/login/$', LoginView.as_view(), name='login-view'),
url(r'^users/logout/$', LogoutView.as_view(), name='logout-view'),
url(r'^users/registration/$', RegistrationView.as_view(), name='registration-view'),
url(r'^dashboard/$', DashboardView.as_view(), name="dashboard-view"),
url(r'^dashboard/send-trainer-message/$', SendTrainerMessageView.as_view(), name="send-trainer-message"),
url(r'^$', IndexView.as_view(), name='index')
url(r'^$', RedirectView.as_view(url='users/login/'))
]
示例5: url
name="responses"
),
url(
r"^wins/review/thanks/$",
TemplateView.as_view(template_name="wins/confirmation-thanks.html"),
name="confirmation-thanks"
),
url(
r"^wins/review/sample/$",
ConfirmationView.as_view(),
name="response_sample"
),
url(
r"^accounts/login/$",
LoginView.as_view(),
name="login",
),
url(
r"^accounts/logout/$",
LogoutView.as_view(),
name="logout",
),
url(r"^admin$", AdminView.as_view(), name="admin-index"),
url(r"^add-user$", AddUserView.as_view(), name="add-user"),
url(r"^new-password$", NewPassView.as_view(), name="new-password"),
url(r"^send-customer-email$", SendCustomerEmailView.as_view(),
name="send-customer-email"),
url(r"^send-admin-customer-email$", SendAdminCustomerEmailView.as_view(),
name="send-admin-customer-email"),
示例6: url
# -*- coding: utf-8 -*-
from django.conf.urls import url
from users.views import LoginView, LogoutView, SignUpView
urlpatterns = [
# Users URLs
url(r'^login$', LoginView.as_view(), name='users_login'),
url(r'^logout$', LogoutView.as_view(), name='users_logout'),
url(r'^signup$', SignUpView.as_view(), name='users_signup'),
]
示例7: patterns
from django.conf.urls import patterns, url
from users.views import LoginView, LoginErrorView
urlpatterns = patterns(
'',
url(r'^login/$', LoginView.as_view(), name='login'),
url(r'^login-error/$', LoginErrorView.as_view(), name='login-error')
)
示例8: SimpleRouter
router = SimpleRouter()
router.register('user_identity', UserIdentityViewSet)
router.register('user_device', UserDeviceViewSet)
router.register('user_login_entry', UserLoginEntryViewSet)
router.register('service', ServiceViewSet)
router.register('user_consent', UserConsentViewSet)
v1_scope_path = path('scope/', ScopeListView.as_view(), name='scope-list')
v1_api_path = path('v1/', include((router.urls + [v1_scope_path], 'v1')))
urlpatterns = [
path('admin/', admin.site.urls),
path('api-tokens/', get_api_tokens_view),
path('accounts/profile/', show_login),
path('accounts/login/', LoginView.as_view()),
path('accounts/logout/', LogoutView.as_view()),
path('accounts/', include(auth_backends.urls, namespace='auth_backends')),
path('accounts/', include(social_auth_urls, namespace='social')),
path('oauth2/applications/', permission_denied),
path('oauth2/authorize/', TunnistamoAuthorizationView.as_view(), name="oauth2_authorize"),
path('oauth2/', include(oauth2_provider.urls, namespace='oauth2_provider')),
re_path(r'^openid/authorize/?$', TunnistamoOidcAuthorizeView.as_view(), name='authorize'),
re_path(r'^openid/end-session/?$', TunnistamoOidcEndSessionView.as_view(), name='end-session'),
path('openid/', include(oidc_provider.urls, namespace='oidc_provider')),
re_path(r'^\.well-known/openid-configuration/?$', OIDCProviderInfoView.as_view(), name='root-provider-info'),
re_path(r'^user/(?P<username>[\[email protected]+-]+)/?$', UserView.as_view()),
path('user/', UserView.as_view()),
path('jwt-token/', GetJWTView.as_view()),
path('login/', LoginView.as_view()),
path('logout/', LogoutView.as_view()),
示例9: Api
from django.contrib import admin
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from django.views.generic.base import TemplateView
from users.views import LoginUser, GetStuffView, LoginView
from tastypie.api import Api
from rest.api import ClientResource
admin.autodiscover()
v1_api = Api(api_name="v1")
v1_api.register(ClientResource())
urlpatterns = patterns('',
url(r'^api/', include(v1_api.urls)),
url(r'^client/', include('clients.urls')),
url(r'^contract/', include('contracts.urls')),
url(r'^projects/', include('projects.urls')),
url(r'^products/', include('products.urls')),
url(r'^photoshoots/', include('photoshoots.urls')),
url(r'^users/', include('users.urls')),
url(r'^admin/', include(admin.site.urls)),
url(r'^auth_google/', LoginView.as_view(), name="auth_google"),
url(r'^get_my_stuff/', GetStuffView.as_view(), name='get_my_stuff'),
url(r'^login/', LoginUser.as_view(), name='user_login'),
#url(r'^login/', 'users.views.user_login', name='user_login'),
url(r'^logout/', 'users.views.user_logout', name='user_logout'),
url(r'', TemplateView.as_view(template_name='clients/list.html')),
)
urlpatterns += staticfiles_urlpatterns()
示例10: import
from django.conf.urls import url, include
from users.views import (
DashboardView,
LoginView,
LogoutView,
)
from django.views.generic import TemplateView
from users import views
urlpatterns = [
url(r'^dashboard/$',DashboardView.as_view(template_name='user/profile.html'), name="dashboard"),
url(r'^logout$', LogoutView.as_view(), name="logout"),
url(r'^payment-url/$', views.buy_my_item, name='pay'),
url(r'^some/obscure/name/', include('paypal.standard.ipn.urls')),
url(r'^$', LoginView.as_view(template_name='user/index.html'), name='login'),
]
示例11: url
2. Add a URL to urlpatterns: url(r'^blog/', include('blog.urls'))
"""
from django.conf.urls import url, include
import xadmin
from django.views.generic import TemplateView
from django.views.static import serve
from django.views.generic.base import RedirectView
from users.views import LoginView, RegisterView, ActiveView, UpdatePasswordView, ResetPasswordView
from courseonline.settings import MEDIA_ROOT
from core.views import LogoutView, IndexView
urlpatterns = [
url(r'^$', IndexView.as_view(), name='index'),
url(r'^index.html$', IndexView.as_view(), name='index_html'),
url(r'^login.html$', LoginView.as_view(), name='login'),
url(r'^logout$', LogoutView.as_view(), name='logout'),
url(r'^register.html$', RegisterView.as_view(), name='register'),
url(r'^active', ActiveView.as_view(), name='active'),
url(r'^password/110$', UpdatePasswordView.as_view(), name='find_password'),
url(r'^password/find', ResetPasswordView.as_view(), name='reset_password'),
url(r'^favicon\.ico$', RedirectView.as_view(url='/static/img/favicon.ico')),
url(r'^teacher/', include('operation.urls', namespace='teacher'), name='teacher'),
url(r'^org/', include('orgzation.urls', namespace='org'), name='orglist'),
url(r'^course/', include('courses.urls', namespace='course'), name='course'),
url(r'^search/', include('core.urls', namespace='search'), name='core'),
url(r'^user/', include('users.urls', namespace='user'), name='user'),
url(r'^test/', include('tests.urls', namespace='test'), name='test'),
# 后台管理
示例12: import
from django.conf.urls import include, url
from django.contrib import admin
from users.views import (
RegisterView, LoginView, LogoutView)
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.views.static import serve
urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^register/$', RegisterView.as_view(), name="user-register"),
url(r'^$', LoginView.as_view(), name="user-login"),
url(r'^logout/$', LogoutView.as_view(), name="logout"),
]
if settings.DEBUG:
urlpatterns += [
url(r'^media/(.*)$', serve,
{'document_root': settings.MEDIA_ROOT}),
]
示例13: path
import users
import xadmin
from django.views.generic import TemplateView
# from users.views import user_login
from Mxonline3.settings import MEDIA_ROOT
from organization.views import OrgView
from users.views import LoginView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdView, LogoutView, \
IndexView
urlpatterns = [
path('xadmin/', xadmin.site.urls),
# TemplateView.as_view会将template转换为view
#path('', TemplateView.as_view(template_name= "index.html"), name= "index"),
path('', IndexView.as_view(), name= "index"),
# 基于类方法实现登录,这里是调用它的方法
path('login/', LoginView.as_view(), name="login"),
# 退出功能url
path('logout/', LogoutView.as_view(), name="logout"),
# 注册url
path("register/", RegisterView.as_view(), name = "register" ),
# 验证码url
path("captcha/", include('captcha.urls')),
# 激活用户url
re_path('active/(?P<active_code>.*)/', ActiveUserView.as_view(), name= "user_active"),
# 忘记密码
path('forget/', ForgetPwdView.as_view(), name= "forget_pwd"),
示例14: DefaultRouter
from django.urls import path, include
from rest_framework.routers import DefaultRouter
from posts.api import PostViewSet
from posts.views import HomeView, PostDetailView, NewPostView
from users.views import UsersView, UserPostView, LoginView, LogoutView, SignupView
from users.api import UserViewSet, UserPostViewSet
router = DefaultRouter()
router.register('posts', PostViewSet, base_name='posts')
router.register('users', UserViewSet, base_name='users')
router.register('blogs', UserPostViewSet, base_name='blogs')
urlpatterns = [
path('admin/', admin.site.urls),
path('', HomeView.as_view(), name="home"),
path('blogs/<username>/<int:pk>', PostDetailView.as_view(), name="post-detail"),
path('blogs/', UsersView.as_view(), name="user-list"),
path('blogs/<username>', UserPostView.as_view(), name="user-post-list"),
path('new-post', NewPostView.as_view(), name='new-post'),
path('login', LoginView.as_view(), name='login'),
path('logout', LogoutView.as_view(), name='logout'),
path('signup', SignupView.as_view(), name='signup'),
# API URLs
path('api/v1/', include(router.urls)),
#path('api/v1/blogs/', UserPostViewSet.as_view({'list'}), name='blog-list'),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
示例15: url
SendAdminEmailView.as_view(),
name='admin-send-admin-email',
),
url(
r"^admin/change-customer-email/$",
ChangeCustomerEmailView.as_view(),
name='admin-change-customer-email',
),
url(
r"^admin/soft-delete/$",
SoftDeleteWinView.as_view(),
name='admin-soft-delete',
),
# Override DRF's default 'cause our includes brute-force protection
url(r"^auth/login/$", LoginView.as_view(), name="login"),
url(r"^auth/is-logged-in/$", IsLoggedIn.as_view(), name="is-logged-in"),
url(r"^user/me/$",
LoggedInUserRetrieveViewSet.as_view({'get': 'retrieve'}), name="user_profile"),
url(r"^auth/logout/", LogoutView.as_view(), name="logout"),
url(
r'^activity-stream/$',
ActivityStreamViewSet.as_view({'get': 'list'}),
name='activity-stream'),
]
if settings.API_DEBUG or WINS_CSV_SECRET_PATH: