当前位置: 首页>>代码示例>>Python>>正文


Python views.LoginView类代码示例

本文整理汇总了Python中account.views.LoginView的典型用法代码示例。如果您正苦于以下问题:Python LoginView类的具体用法?Python LoginView怎么用?Python LoginView使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了LoginView类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: get

    def get(self, request, *args, **kwargs):
        if not request.user.is_authenticated():
            view = LoginView()
            return view.dispatch(request)

        self.form = self.form_class()
        self.formset = self.formset_class()
        context = self.compute_context()
        return self.render_to_response(context)
开发者ID:bright-pan,项目名称:Agops,代码行数:9,代码来源:views.py

示例2: test_get

 def test_get(self):
     request = self.factory.get(reverse("account_login"))
     request.user = AnonymousUser()
     response = LoginView.as_view()(request)
     self.assertEqual(response.status_code, 200)
     self.assertEqual(response.template_name, ["account/login.html"])
开发者ID:Billybob,项目名称:django-user-accounts,代码行数:6,代码来源:test_views.py

示例3: url

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. Add an import:  from blog import urls as blog_urls
    2. Add a URL to urlpatterns:  url(r'^blog/', include(blog_urls))
"""
from account.views import LoginView
from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth import views as auth_views
from django.core.urlresolvers import reverse_lazy

urlpatterns = [
                  url(r'^accounts/login/$', LoginView.as_view(template_name='ldap_login.html'), name='login'),
                  url(r'^accounts/logout/$',
                      auth_views.logout,
                      {'next_page': reverse_lazy('index')},
                      name='logout'),
                  url(r'^', include('mentoring.urls')),
                  url(r'^admin/', include(admin.site.urls)),
              ] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

handler500 = 'mentoring.views.handler500'
handler404 = 'mentoring.views.handler500'
开发者ID:AleksejManaev,项目名称:bachelorarbeit-fabian-ullmann,代码行数:30,代码来源:urls.py

示例4: patterns

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"),
)
开发者ID:Amechi101,项目名称:indieapp,代码行数:20,代码来源:urls.py

示例5: url

# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from account.views import ChangePasswordView, SignupView, LoginView
from django.conf.urls import include, url
from django.contrib import admin
from example_thirdparty.forms import SignupFormWithCaptcha

urlpatterns = [
    url(r"^admin/", include(admin.site.urls)),
    # aliases to match original django-registration urls
    url(r"^accounts/password/$", ChangePasswordView.as_view(), name="auth_password_change"),
    url(r"^accounts/signup/$", SignupView.as_view(form_class=SignupFormWithCaptcha), name="registration_register"),
    url(r"^accounts/login/$", LoginView.as_view(), name="auth_login"),
    url(r"^accounts/", include("account.urls")),
    url(r"^captcha/", include("captcha.urls")),
    url(r"^", include("pybb.urls", namespace="pybb")),
]
开发者ID:hovel,项目名称:pybbm,代码行数:18,代码来源:urls.py

示例6: import


if 'account' in settings.INSTALLED_APPS:
    # We use localized URLs in our app. django-user-accounts doesn't. Too bad.

    from account.views import (SignupView, LoginView, LogoutView, DeleteView,
                               ConfirmEmailView, ChangePasswordView,
                               PasswordResetView, PasswordResetTokenView,
                               SettingsView)

    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"),
开发者ID:1flow,项目名称:1flow,代码行数:29,代码来源:urls.py

示例7: import

# coding=utf-8

from django.conf.urls import url
from django.contrib.auth import views as auth_views
from account.views import (LoginView, MessageView, CheckMessageView,
                           RegisterView, ResetPasswordView, ProfileView,
                           FriendsView)


urlpatterns = [
    url(r'^login/$', LoginView.as_view(), name='login'),
    url(r'^logout/$', auth_views.logout, name='logout'),

    url(r'^register$', RegisterView.as_view(), name='register'),
    url(r'^send_message$', MessageView.as_view(), name='send_message'),
    url(r'^auth_message$', CheckMessageView.as_view(), name='auth_message'),
    url(r'^reset_password', ResetPasswordView.as_view(), name='reset_password'),
    url(r'^profile', ProfileView.as_view(), name='profile'),
    url(r'^friends', FriendsView.as_view(), name='friends'),
]
开发者ID:renjimin,项目名称:alatting,代码行数:20,代码来源:urls.py

示例8: url

from django.conf.urls import url
from account.views import LoginView, RegisterView, UserListView, ProfileDetailView, ProfileUpdateView
from permapp.views import News1CreateView, News1DeleteView, News1DetailView, News1ListView, News1UpdateView
urlpatterns = [
    url(r'^login/$', LoginView.as_view(), name="login"),
    url(r'^register/$', RegisterView.as_view(), name="register"),
    url(r'^users/$', UserListView.as_view(), name="users"),
    url(r'^logout/$', 'django.contrib.auth.views.logout',{'next_page': '/'},name="logout"),
    url(r'^profile/(?P<pk>\d+)/$', ProfileDetailView.as_view(), name='profile'),
    url(r'^profile/(?P<pk>\d+)/edit/$', ProfileUpdateView.as_view(), name='profile-edit'),

    url(r'^news1/$', News1ListView.as_view(), name="news1-list"),
    url(r'^news1/add/$', News1CreateView.as_view(), name="news1-add"),
    url(r'^news1/(?P<pk>\d+)/$', News1DetailView.as_view(), name="news1-detail"),
    url(r'^news1/(?P<pk>\d+)/edit/$', News1UpdateView.as_view(), name="news1-edit"),
    url(r'^news1/(?P<pk>\d+)/delete/$', News1DeleteView.as_view(), name="news1-delete"),


]
开发者ID:DBrzoskowski,项目名称:Django,代码行数:19,代码来源:urls.py

示例9: patterns

import settings
from django.conf.urls import patterns, include, url
from account.views import LoginView, RegisterView, logout_view, ResetPassword
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()

urlpatterns = patterns('',
    # Examples:
    url(r'auth/', include('social_auth.urls')),
    url(r'^$', LoginView.as_view(), name="login-view"),
    url(r'^register/$', RegisterView.as_view(), name="register-view"),
    url(r'^logout/$', logout_view, {'next_page': '/'}, name="logout-view"),
    #url(r'^signup/$', SignupView.as_view(), name="sign-up"),
    url(r'^lyrics/',include('lyrics.urls')),
    url(r'^reset_password',ResetPassword.as_view(), name="reset_password"),
    
    # url(r'^$', 'LyricsManiac.views.home', name='home'),
    # url(r'^LyricsManiac/', include('LyricsManiac.foo.urls')),

    # Uncomment the admin/doc line below to enable admin documentation:
    # url(r'^admin/doc/', include('django.contrib.admindocs.urls')),

    # Uncomment the next line to enable the admin:
    url(r'^admin/', include(admin.site.urls)),
)

urlpatterns += patterns('',
        (r'^media/(?P<path>.*)$', 'django.views.static.serve', {
        'document_root': settings.MEDIA_ROOT}))
开发者ID:vijay-shanker,项目名称:LyricsManiac,代码行数:30,代码来源:urls.py

示例10: patterns

v1_api.register(ListResource())
v1_api.register(UserResource())
v1_api.register(FeedbackResource())
v1_api.register(FollowResource())
v1_api.register(CommentResource())
v1_api.register(ListInvitationResource())
v1_api.register(UserTourResource())
v1_api.register(FeedCountResource())

urlpatterns = patterns("",
    url(r"^admin/", include(admin.site.urls)),
    #url(r'adminx/', include(xadmin.site.urls)),
    url(r'^harvest/', include("harvest.urls")),
    url(r"^accounts/signup/$", SignupView.as_view(form_class=SignupForm), name="account_signup"),
    url(r"^accounts/settings/$", SettingsView.as_view(form_class=SettingsForm), name="account_settings"),
    url(r"^accounts/login/$", LoginView.as_view(form_class=LoginEmailOrUsernameForm), name="account_login"),

    url(r'', include('social_auth.urls')),
    url(r'misc/', include('misc.urls')),
    url(r"^accounts/", include("account.urls")),
    url(r'^api/', include(v1_api.urls)),
    url(r'^comments/', include('django.contrib.comments.urls')),
    url(r'^profiles/profile/(?P<username>\w+)/', redirect_to, {'url': '/profiles/edit'}),
    url(r'^help/', direct_to_template, {'template': 'help.html'}, name="help"),
    url(r'^about/', direct_to_template, {'template': 'about.html'}, name="about"),
    url(r'^profiles/', include('idios.urls')),
    url(r'^invite/', include('kaleo.urls')),
    url(r'^notifications/', include('notifications.urls', namespace="notifications")),
    url(r'^avatar/', include('avatar.urls')),
    url(r'^snapshot/', include('snapshot.urls')),
    url(r'^note/', include('note.urls')),
开发者ID:enml,项目名称:lianpeng,代码行数:31,代码来源:urls.py

示例11: import


if 'account' in settings.INSTALLED_APPS:
    # We use localized URLs in our app. django-user-accounts doesn't. Too bad.

    from account.views import (SignupView, LoginView, LogoutView, DeleteView,
                               ConfirmEmailView, ChangePasswordView,
                               PasswordResetView, PasswordResetTokenView,
                               SettingsView)

    urlpatterns += i18n_patterns(
        "",
        url(_(r"^signup/$"), SignupView.as_view(),
            name="account_signup"),
        # original is: url(_(r"^login/$"), but we prefer:
        url(_(ur'^signin/$'), LoginView.as_view(),
            name="signin"),
        # original is: url(_(r"^logout/$"), but we prefer:
        url(_(ur'^signout/$'), 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"),
开发者ID:EliotBerriot,项目名称:1flow,代码行数:29,代码来源:urls.py

示例12: patterns

from django.conf.urls import patterns, url

from account.views import LoginView, RegisterView, account_view, LogoutView


urlpatterns = patterns('',
    url(r'^login/$', LoginView.as_view(), name="account-login"),
    url(r'^logout/$', LogoutView.as_view(), name="account-logout"),
    url(r'^register/$', RegisterView.as_view(), name="account-register"),
    url(r'^$', account_view, name="account-page")
)
开发者ID:qrees,项目名称:backbone-gallery,代码行数:11,代码来源:urls.py


注:本文中的account.views.LoginView类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。