コード例 #1
0
ファイル: urls.py プロジェクト: DiankaDS/university
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import TemplateView, RedirectView
from core.views import UserRegistrationView, UserProfileView
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    url(r'^$', TemplateView.as_view(template_name="home_page.html"),
        name="home_page"),
    url(r'^login/$', 'django.contrib.auth.views.login', name="login"),
    url(r'^logout/$', 'django.contrib.auth.views.logout',
        {'next_page': "home_page"}, name="logout"),
    url(r'^accounts/profile/', RedirectView.as_view(pattern_name="home_page")),
    url(r'^registration/$', UserRegistrationView.as_view(), name="reg"),
    url(r'^complete_registration/$', TemplateView.as_view(
        template_name="registration/success_registration.html"),
        name="success_reg"),
    url(r'^admin/', include(admin.site.urls)),
    url(r'^students/', include('student.urls', namespace='students')),
    url(r'^groups/', include('group.urls', namespace='groups')),
    url(r'user_profile/$', UserProfileView.as_view(), name='user_profile'),
    url(r'api/v1/', include('api.urls', namespace='api')),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
コード例 #2
0
ファイル: urls.py プロジェクト: devendraotari/HRMS_project
login 
Registration
authentication
"""
from django.urls import path
from rest_framework_simplejwt import views as jwt_views
from core.views import (
    UserRegistrationView,
    UserLoginView,
    UserForgotPasswordView,
    HRUserRegistrationView,
)

urlpatterns = [
    # Your URLs...
    path("token/",
         jwt_views.TokenObtainPairView.as_view(),
         name="token_obtain_pair"),
    path("token/refresh/",
         jwt_views.TokenRefreshView.as_view(),
         name="token_refresh"),
    path("register/", UserRegistrationView.as_view()),
    path("register-hr/", HRUserRegistrationView.as_view()),
    path("login/", UserLoginView.as_view()),

    # not implemented
    # path('forgotpassword/',UserForgotPasswordView.as_view()),
    # path('changeusername/')
    # path('changepssword/')
]
コード例 #3
0
from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static

from core.views import (BookCreateView, BookListView, BookDetailView,
                        BookUpdateView, UserRegistrationView)
from rest_framework_simplejwt.views import (
    TokenObtainPairView,
    TokenRefreshView,
    TokenVerifyView,
)

urlpatterns = [
    path('admin/', admin.site.urls),
    path('api-auth/', include('rest_framework.urls')),
    path('api/registration/', UserRegistrationView.as_view()),
    path('api/token/', TokenObtainPairView.as_view(),
         name='token_obtain_pair'),
    path('api/token/refresh/',
         TokenRefreshView.as_view(),
         name='token_refresh'),
    path('api/token/verify/', TokenVerifyView.as_view(), name='token_verify'),
    path('api/book/', BookListView.as_view()),
    path('api/book/create/', BookCreateView.as_view()),
    path('api/book/<int:pk>/detail/', BookDetailView.as_view()),
    path('api/book/<int:pk>/update/', BookUpdateView.as_view()),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
コード例 #4
0
from django.contrib.auth.views import login, logout
from core.views import UserView, UsersList, MainPage, UserRegistrationView
from django.conf.urls import include, url

urlpatterns = [
    url(r'^$', MainPage.as_view(), name="main_page"),
    url(r'^users/$', UsersList.as_view(), name="all_users"),
    url(r'^user/(?P<user_id>\d+)/$', UserView.as_view(), name="one_user"),
    url(r'^login/$', login, {'template_name': 'core/login.html'},
        name="login"),
    url(r'^logout/$', logout, name="logout"),
    url(r'^registration/$',
        UserRegistrationView.as_view(),
        name="registration"),
]
コード例 #5
0
ファイル: urls.py プロジェクト: adamslapins/velo.lv
# coding=utf-8
from __future__ import unicode_literals  # u'' strings by default # Awesome :)
from django.conf.urls import patterns, url
from django.core.urlresolvers import reverse_lazy
from core.forms import PasswordResetForm, SetPasswordFormCustom, AuthenticationFormCustom
from core.views import UserRegistrationView, UserEmailConfirm, ChangeEmailView, ChangePasswordView, ProfileView, \
    ResendEmailView
from django.utils.translation import ugettext_lazy as _
from payment.views import TeamPayView
from registration.views import MyApplicationList
from team.views import MyTeamList, TeamCreateView, TeamUpdateView, TeamApplyList, TeamApply

urlpatterns = patterns('',
                       url(_(r'^register/$'), UserRegistrationView.as_view(), name="register"),
                       url(_(r'^register/email/$'), 'core.views.new_user_email_view', name="register_user_email"),


                       url(_(
                           r'^email/confirm/(?P<slug>[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12})/$'),
                           UserEmailConfirm.as_view(), name='email_confirmation_view'),
                       url(_(r'^email/$'), ChangeEmailView.as_view(), name='email_change_view'),
                       url(_(r'^email/resend/$'), ResendEmailView.as_view(), name='email_resend_view'),
                       url(_(r'^password_change/$'), ChangePasswordView.as_view(), name='password_change'),
                       url(_(r'^login/$'), 'core.views.login', name='login',
                           kwargs={'authentication_form': AuthenticationFormCustom}),
                       url(_(r'^logout/$'), 'django.contrib.auth.views.logout', {'next_page': '/'}, name='logout'),
                       url(_(r'^profile/$'), ProfileView.as_view(), name='profile'),

                       url(_(r'^password_reset/$'), 'django.contrib.auth.views.password_reset', name='password_reset',
                           kwargs={'post_reset_redirect': reverse_lazy('accounts:password_reset_done'),
                                   'template_name': 'registration/password_reset_form_velo.html',