• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Python views.LoginView类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



在下文中一共展示了LoginView类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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()),
)
开发者ID:bgilroy26,项目名称:pickem_football,代码行数:26,代码来源:urls.py


示例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)),
]
开发者ID:ymdx,项目名称:Practica_Django,代码行数:31,代码来源:urls.py


示例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"),

]
开发者ID:adammalinowski,项目名称:export-wins-ui,代码行数:22,代码来源:urls.py


示例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/'))

]
开发者ID:HebertC,项目名称:gym_final,代码行数:30,代码来源:urls.py


示例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"),
开发者ID:UKTradeInvestment,项目名称:export-wins-ui,代码行数:31,代码来源:urls.py


示例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'),
]
开发者ID:mvelezserrano,项目名称:wordplease,代码行数:11,代码来源:urls.py


示例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')
)
开发者ID:31H0B1eV,项目名称:photoplanet-1,代码行数:8,代码来源:urls.py


示例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()),
开发者ID:City-of-Helsinki,项目名称:hkisaml,代码行数:30,代码来源:urls.py


示例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()
开发者ID:jghyllebert,项目名称:tracktool,代码行数:31,代码来源:urls.py


示例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'),

]
开发者ID:xandriatiu,项目名称:Post-it-later,代码行数:20,代码来源:urls.py


示例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'),

    # 后台管理
开发者ID:ilib0x00000000,项目名称:NULL,代码行数:31,代码来源:urls.py


示例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}),
    ]
开发者ID:pprolancer,项目名称:internal-ecom,代码行数:23,代码来源:urls.py


示例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"),
开发者ID:sloth-zpz,项目名称:Mxonline3,代码行数:30,代码来源:urls.py


示例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)
开发者ID:osebastianv,项目名称:Practica8_Python,代码行数:30,代码来源:urls.py


示例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:
开发者ID:UKTradeInvestment,项目名称:export-wins-data,代码行数:31,代码来源:urls.py


示例16: url

from se2015.views import IndexView

from records.views import ExerciseRecordView, ExamRecordView
from records.views import ExamRecordUserView
from exercises.views import ExerciseView, SkillView, GradeView, ExamDetailView
from exercises.views import ExamListView


urlpatterns = [
    url(r'^api/avatar/(?P<username>.+)/$', AvatarView.as_view()),
    url(r'^api/v1/exam_list/(?P<grade_id>.+)/$', ExamListView.as_view()),
    url(r'^api/v1/exam/(?P<exam_id>.+)/$', ExamDetailView.as_view()),
    url(r'^api/v1/exam_record_user/(?P<exam_id>.+)/$',
        ExamRecordUserView.as_view()),
    url(r'^api/v1/exam_record/(?P<exam_id>.+)/$', ExamRecordView.as_view()),
    url(r'^api/v1/exercise/(?P<grade_id>.+)/(?P<skill_id>.+)/$',
        ExerciseView.as_view()),
    url(r'^api/v1/exercise/(?P<grade_id>.+)/$', SkillView.as_view()),
    url(r'^api/v1/grades/$', GradeView.as_view()),
    url(r'^api/v1/accounts/records/(?P<username>.+)/$',
        ExerciseRecordView.as_view(),
        name='recordDetail'),
    url(r'^api/v1/accounts/(?P<username>.+)/$', UserDetailView.as_view(),
        name='detail'),
    url(r'^api/v1/accounts/', UserListView.as_view(), name='list'),
    url(r'^api/v1/auth/login/$', LoginView.as_view(), name='login'),
    url(r'^api/v1/auth/logout/$', LogoutView.as_view(), name='logout'),
    url(r'^admin/', include(admin.site.urls)),
    url('^.*$', IndexView.as_view(), name='index'),
]
开发者ID:tamhoang1412,项目名称:se2015,代码行数:30,代码来源:urls.py


示例17: url

from django.conf.urls import url
from django.contrib import admin
from django.contrib.auth.decorators import login_required
from django.views.static import serve

from contest.models import Vote
from contest.views import HomeView, SponsorDetailsView, ContestDetailsView, \
    contest_upload_photo, contest_vote_entry
from users.decorators import redirect_authenticated
from users.views import RegisterView, LoginView, logout, ProfileView


urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^register/?$', redirect_authenticated(RegisterView.as_view()), name='register'),
    url(r'^login/?$', redirect_authenticated(LoginView.as_view()), name='login'),
    url(r'^logout/?$', logout, name='logout'),

    url(r'^sponsor/details/(?P<slug>[\w_-]+)/?$', SponsorDetailsView.as_view(), name='sponsor_details'),
    url(r'^contest/details/(?P<contest_slug>[\w_-]+)/entry/(?P<entry_id>\d+)/upvote/?$', contest_vote_entry, {'vote_type': Vote.UPVOTE}, name='contest_upvote_entry'),
    url(r'^contest/details/(?P<contest_slug>[\w_-]+)/entry/(?P<entry_id>\d+)/downvote/?$', contest_vote_entry, {'vote_type': Vote.DOWNVOTE}, name='contest_downvote_entry'),
    url(r'^contest/details/(?P<slug>[\w_-]+)/?$', ContestDetailsView.as_view(), name='contest_details'),
    url(r'^contest/upload/(?P<slug>[\w_-]+)/?$', contest_upload_photo, name='contest_upload_photo'),

    url(r'^profile/?$', login_required(ProfileView.as_view()), name='profile'),
    url(r'^$', HomeView.as_view(), name='home'),
]

# Add media folder to urls when DEBUG = True
if settings.DEBUG:
    urlpatterns.append(
开发者ID:RevolutionTech,项目名称:flamingo,代码行数:31,代码来源:urls.py


示例18: patterns

from django.conf.urls import patterns, include, url
from django.contrib.auth.decorators import login_required
from django.contrib.auth.views import password_reset_confirm, password_reset_complete
from users.views import LoginView, LogoutView, RegistrationView, GetUserView, PasswordResetView

urlpatterns = patterns('',
    url(r'^login/', LoginView.as_view()),
    url(r'^logout/', LogoutView.as_view()),
    url(r'^register/', RegistrationView.as_view()),
    url(r'^get/', GetUserView.as_view()),
    url(r'^password_reset/', PasswordResetView.as_view()),
    url(r'^confirm_reset/(?P<uidb64>[\d\w\-_]+)/(?P<token>[\d\w-]+)/', password_reset_confirm, name='password_reset_confirm'),
    url(r'^complete_reset/', password_reset_complete, name='password_reset_complete'),
)
开发者ID:expositionrabbit,项目名称:eppabasic,代码行数:14,代码来源:urls.py


示例19: include

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, include
from django.views.static import serve
import xadmin

from users.views import LoginView, LogoutView, RegisterView, ActiveUserView, ForgetPwdView, ResetView, ModifyPwdView
from users.views import IndexView
from testonline.settings import MEDIA_ROOT

urlpatterns = [
    url(r'^xadmin/', xadmin.site.urls),
    url('^$', IndexView.as_view(), name="index"),
    url('^login/$', LoginView.as_view(), name="login"),
    url('^logout/$', LogoutView.as_view(), name="logout"),
    url('^register/$', RegisterView.as_view(), name="register"),
    url(r'^captcha/', include('captcha.urls')),
    url(r'^active/(?P<active_code>.*)/$', ActiveUserView.as_view(), name="user_active"),
    url(r'^forget/$', ForgetPwdView.as_view(), name="forget_pwd"),
    url(r'^reset/(?P<active_code>.*)/$', ResetView.as_view(), name="reset_pwd"),
    url(r'^modify_pwd/$', ModifyPwdView.as_view(), name="modify_pwd"),

    # 课程机构url配置
    url(r'^org/', include('organization.urls', namespace='org')),

    # 课程相关url配置
    url(r'^course/', include('courses.urls', namespace='course')),

    # 配置上传文件的访问处理函数
开发者ID:xypisces,项目名称:python,代码行数:31,代码来源:urls.py


示例20: pk

from blogs.views import BlogsView

urlpatterns = [
    # (?P<pk>[0-9]+) => valor en parámetro pk (?P<pk>), que será 1 o más números del 0 al 9

    url(r'^admin/', include(admin.site.urls)),

    # urls nombradas
    url(r'^blogs/$', BlogsView.as_view(), name='blog_home'),    # listado de blogs, con vista basada en clase BlogsView
    url(r'^$', HomeView.as_view(), name='post_home'),           # listado de posts publicados, con vista basada en clase HomeView
    url(r'^blogs/(?P<username>[a-z]+)/$', UserPostsView.as_view(), name='blog_posts'),     # listado posts blog usuario, basada en la clase UserPostView
    url(r'^blogs/(?P<username>[a-zA-Z]+)/(?P<post_id>[0-9]+)$', DetailView.as_view(), name='post_detail'),   # detalle post, basado en clase DetailView


    url(r'^signup/$', SignupView.as_view(), name='user_signup'), # signup o creación de cuenta de usuario, con vista basada en clase SignupView
    url(r'^login$', LoginView.as_view(), name='user_login'),    # login, con vista basada en clase LoginView
    url(r'^logout$', LogoutView.as_view(), name='user_logout'), # logout, con vista basada en clase LogoutView

    url(r'^new-post/$', CreateView.as_view(), name='post_create'),   # creación nuevo post, con vista basada en clase CreateView


    # Users' API URLs
    url(r'^api/1.0/users/$', UserListAPI.as_view(), name='user_list_api'),      # url con listado de users para la API, basado en clases
    url(r'^api/1.0/users/(?P<pk>[0-9]+)$', UserDetailAPI.as_view(), name='user_detail_api'),     #url detalle usuario para la api

    # Posts' API URLs
    url(r'^api/1.0/blogs/(?P<username>[a-z]+)/$', PostListAPI.as_view(), name='post_list_api'),     # API listado de posts de blog
    url(r'^api/1.0/posts/(?P<pk>[0-9]+)$', PostDetailAPI.as_view(), name='post_detail_api'),     # API detalle de post: CRUD.

    # Blogs' API URLs
    url(r'^api/1.0/blogs/$', BlogListAPI.as_view(), name='blog_list_api')  # API listado blogs
开发者ID:daviddetena,项目名称:AGBO_Python-Django-REST_Wordplease,代码行数:31,代码来源:urls.py



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python usocket.getaddrinfo函数代码示例发布时间:2022-05-27
下一篇:
Python views._login函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap