Пример #1
1
def get_patterns(user_model):
    # Registration urls
    return [
        path(
            settings.LOGIN_URL.lstrip('/'),
            LoginView.as_view(**dict(
                template_name='users/login.html',
                authentication_form=AuthenticationForm,
                extra_context=dict(
                    password_reset_url=reverse_lazy('users-password_reset'),
                    login_url=settings.LOGIN_URL,
                    next=settings.LOGIN_REDIRECT_URL,
                    login_view=True
                )
            )),
            name='users-login'
        ),
        path(
            'users/logout/',
            LogoutView.as_view(**dict(
                template_name='users/logged_out.html',
                next_page=settings.LOGOUT_REDIRECT_URL
            )),
            name='users-logout'
        ),
        # account confirmation url, protected by secret token; displayed when the users clicked the account confirm url
        # in its account confirmation email
        re_path(
            r'^users/account_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
            account_confirm, dict(
                template_name='users/account_confirm.html',
                set_password_form=AccountActivationPasswordForm,
                post_reset_redirect='/users/account_confirm_complete/',
                user_model=user_model
            ),
            name='users-account_confirm'
        ),
        # indicated that the account was successfully confirmed
        path(
            'users/account_confirm_complete/',
            TemplateView.as_view(
                template_name='users/account_confirm_complete.html',
                extra_context=dict(
                    login_redirect_url=settings.LOGIN_REDIRECT_URL,
                    login_url=settings.LOGIN_URL,
                    user_model=user_model
                )
            ),
            name='users-account_confirm_complete'
        ),

        # displays a form that takes a user's email address; when submitted, an email with a password reset url is sent
        # to that user
        path(
            'users/password_reset/',
            PasswordResetView.as_view(**dict(
                template_name='users/password_reset.html',
                success_url=reverse_lazy('users-password-reset-done'),
                email_template_name='users/email/password_reset.html',
                form_class=get_password_reset_form('users-password_reset_confirm', user_model),
            )),
            name='users-password_reset'
        ),
        # displays that the password change email has been sent.
        path(
            'users/password_reset_done/',
            PasswordResetDoneView.as_view(**dict(
                template_name='users/password_reset_done.html',
                extra_context=dict(login_url=settings.LOGIN_URL),
            )),
            name='users-password-reset-done'
        ),
        # displays the form where the user can choose its new password
        re_path(
            r'^users/password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
            PasswordResetConfirmView.as_view(**dict(
                template_name='users/password_reset_confirm.html',
                success_url=reverse_lazy('user-password_reset_complete'),
            )),
            name='users-password_reset_confirm'
        ),
        # indicates that the user's password has been successfully changed.
        path(
            'users/password_reset_complete/',
            PasswordResetCompleteView.as_view(**dict(
                template_name='users/password_reset_complete.html',
                extra_context=dict(login_url=settings.LOGIN_URL)
            )),
            name='user-password_reset_complete'
        )
    ]
Пример #2
0
    def test_titles(self):
        rf = RequestFactory()
        user = User.objects.create_user('jsmith', '*****@*****.**', 'pass')
        user = authenticate(username=user.username, password='******')
        request = rf.get('/somepath/')
        request.user = user

        response = PasswordResetView.as_view(success_url='dummy/')(request)
        self.assertContains(response, '<title>Password reset</title>')
        self.assertContains(response, '<h1>Password reset</h1>')

        response = PasswordResetDoneView.as_view()(request)
        self.assertContains(response, '<title>Password reset sent</title>')
        self.assertContains(response, '<h1>Password reset sent</h1>')

        # PasswordResetConfirmView invalid token
        response = PasswordResetConfirmView.as_view(success_url='dummy/')(request, uidb64='Bad', token='Bad')
        self.assertContains(response, '<title>Password reset unsuccessful</title>')
        self.assertContains(response, '<h1>Password reset unsuccessful</h1>')

        # PasswordResetConfirmView valid token
        default_token_generator = PasswordResetTokenGenerator()
        token = default_token_generator.make_token(user)
        uidb64 = force_text(urlsafe_base64_encode(force_bytes(user.pk)))
        response = PasswordResetConfirmView.as_view(success_url='dummy/')(request, uidb64=uidb64, token=token)
        self.assertContains(response, '<title>Enter new password</title>')
        self.assertContains(response, '<h1>Enter new password</h1>')

        response = PasswordResetCompleteView.as_view()(request)
        self.assertContains(response, '<title>Password reset complete</title>')
        self.assertContains(response, '<h1>Password reset complete</h1>')

        response = PasswordChangeView.as_view(success_url='dummy/')(request)
        self.assertContains(response, '<title>Password change</title>')
        self.assertContains(response, '<h1>Password change</h1>')

        response = PasswordChangeDoneView.as_view()(request)
        self.assertContains(response, '<title>Password change successful</title>')
        self.assertContains(response, '<h1>Password change successful</h1>')
Пример #3
0
from django.urls import path
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
from .views import AccountsView

urlpatterns = [
    path('login/', AccountsView.user_login),
    path('logout/', AccountsView.user_logout),
    path('register/', AccountsView.register),
    path('activate/', AccountsView.activate_account),
    path('reset_password/',
         PasswordResetView.as_view(template_name='password/reset.html'),
         name='reset_password'),
    path('reset_password_sent/',
         PasswordResetDoneView.as_view(template_name='password/sent.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(template_name='password/form.html'),
         name='password_reset_confirm'),
    path('reset_password_complete/',
         PasswordResetCompleteView.as_view(template_name='password/done.html'),
         name='password_reset_complete'),
]
Пример #4
0
from django.urls import path, reverse_lazy
#from django.contrib.auth.views import password_reset, password_reset_done, password_reset_confirm, password_reset_complete
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    #    path('', password_reset, {'post_reset_redirect': reverse_lazy('password_reset_done')}, name='password_reset'),
    #    path('done/', password_reset_done, name='password_reset_done'),
    #    path('<uidb64>[0-9A-Za-z]+-<token>.+)/', password_reset_confirm,{'post_reset_redirect': reverse_lazy('password_reset_complete')}, name='password_reset_confirm'),
    #    path('complete/', password_reset_complete, name='password_reset_complete')
    path('password_reset/', PasswordResetView.as_view(),
         name='password_reset'),
    path('password_reset_done/',
         PasswordResetDoneView.as_view(),
         name='password_reset_done'),
    path('<uidb64>[0-9A-Za-z]+-<token>.+)/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('complete/',
         PasswordResetCompleteView.as_view(),
         name='password_reset_complete'),
]
Пример #5
0
         LogoutView.as_view(template_name='authapp/logged_out.html'),
         name='logout'),
    path('password_change/',
         PasswordChangeView.as_view(
             template_name='authapp/password_change_form.html'),
         name='password_change'),
    path('password_change/dond/',
         PasswordChangeDoneView.as_view(
             template_name='authapp/password_change_done.html'),
         name='password_change_done'),
    path('password_reset/',
         PasswordResetView.as_view(
             template_name='authapp/password_reset_form.html',
             email_template_name='authapp/password_reset_email.html',
             success_url=reverse_lazy('authapp:password_reset_done')),
         name='password_reset'),
    path('password_reset/done/',
         PasswordResetDoneView.as_view(
             template_name='authapp/password_reset_done.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='authapp/password_reset_confirm.html',
             success_url=reverse_lazy('authapp:login')),
         name='password_reset_confirm'),
    path('reset/done/',
         PasswordResetCompleteView.as_view(
             template_name='authapp/password_reset_complete.html'),
         name='password_reset_complete'),
]
Пример #6
0
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""
from django.contrib import admin
from django.urls import path
from django.conf.urls import url, include
from django.contrib.auth.views import LoginView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView, logout_then_login
from django.contrib.auth import views as auth_views
from django.urls import reverse_lazy


urlpatterns = [
    path('admin/', admin.site.urls),
    url(r'^preguntas/', include ('apps.preguntas.urls', namespace="pregunta")),

    url(r'^usuarios/', include ('apps.usuarios.urls', namespace="usuarios")),

    url(r'^accounts/login/', LoginView.as_view(template_name='index.html'), name="login"),

    url(r'^logout/',logout_then_login, name='logout'),

    path('reset/password_reset', PasswordResetView.as_view(email_template_name="registration/password_reset_email.html"), name = 'password_reset'),

    path('reset/password_reset_done', PasswordResetDoneView.as_view(), name = 'password_reset_done'),

    path('reset/<uidb64>/<token>', PasswordResetConfirmView.as_view(), name = 'password_reset_confirm'),

    path('reset/done',PasswordResetCompleteView.as_view() , name = 'password_reset_complete'),
 
]

from django.conf.urls import url, re_path
from django.urls import reverse_lazy
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    url('^$', PasswordResetView.as_view(),
        {'post_reset_redirect': reverse_lazy(
            'password_reset_done')}, name='password_reset'),

    re_path(r'^done/$', PasswordResetDoneView.as_view(),
            name='password_reset_done'),

    re_path(r'^(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', PasswordResetConfirmView.as_view(),
            {'post_reset_confirm': reverse_lazy('password_reset_complete')}, name='password_reset_confirm'),

    re_path(r'^complete/$', PasswordResetCompleteView.as_view(),
            name='password_reset_complete')
]
Пример #8
0
    only servers where the static files are really just for /admin

    Passing insecure=True allows serve_static to process, and ignores
    the DEBUG=False setting
    """
    return serve_static(request, path, insecure=True, **kwargs)


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include("Risk_project_ufps.urls")),
    path('reset/password_reset',
         PasswordResetView.as_view(
             template_name='registration/password_reset_formf.html',
             email_template_name='registration/password_reset_emailf.html'),
         name="password_reset"),
    path('reset/password_reset_done',
         PasswordResetDoneView.as_view(
             template_name='registration/password_reset_donef.html'),
         name='password_reset_done'),
    re_path(r'^reset/(?P<uidb64>[0-9A-za-z_\-]+)/(?P<token>.+)/$',
            PasswordResetConfirmView.as_view(
                template_name='registration/password_reset_confirmf.html'),
            name='password_reset_confirm'),
    path('reset/done',
         PasswordResetCompleteView.as_view(
             template_name='registration/password_reset_completef.html'),
         name='password_reset_complete'),
    re_path(r'static/(.+)', _static_butler),
]
Пример #9
0
    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, re_path, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from accounts import views as accounts_views
from django.conf.urls.static import static
from django.conf import settings
from django.contrib.auth.views import PasswordResetCompleteView

urlpatterns = [
	path('reset/done/', PasswordResetCompleteView.as_view(template_name="accounts/reset_password_complete.html"), name="password_reset_complete"),
    path('admin/', admin.site.urls),
	path('api/',include('api.urls')),
    re_path(r'^accounts/', include('accounts.urls', namespace='accounts')),
    re_path(r'^$', accounts_views.home, name="home"),
    path('', include('django.contrib.auth.urls')),
    path('forums/', include('forums.urls')),
	path('friends/', include('friends.urls'), name="friends"),
    path('polls/', include('polls.urls')),
	re_path(r'^files/', include('files.urls')),
    re_path(r'^chat/', include('chat.urls')),
]

urlpatterns += staticfiles_urlpatterns()
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #10
0
 def test_PasswordResetCompleteView(self):
     response = PasswordResetCompleteView.as_view()(self.request)
     self.assertContains(response, '<title>Password reset complete</title>')
     self.assertContains(response, '<h1>Password reset complete</h1>')
Пример #11
0
        PasswordResetView.as_view(
            template_name="authnapp/password_reset.html",
            email_template_name="authnapp/password_reset_email.html",
            success_url=reverse_lazy("auth:password_reset_done"),
            form_class=MyPassResetForm,
        ),
        name="password_reset",
    ),
    re_path(
        r"^password-reset/done/$",
        PasswordResetDoneView.as_view(
            template_name="authnapp/password_reset_done.html", ),
        name="password_reset_done",
    ),
    re_path(
        r"^password-reset/confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$",
        PasswordResetConfirmView.as_view(
            template_name="authnapp/password_reset_confirm.html",
            success_url=reverse_lazy("auth:password_reset_complete"),
            form_class=MyPassSetForm,
        ),
        name="password_reset_confirm",
    ),
    re_path(
        r"^password-reset/complete/$",
        PasswordResetCompleteView.as_view(
            template_name="authnapp/password_reset_complete.html", ),
        name="password_reset_complete",
    ),
]
Пример #12
0
from .forms import MyLoginForm
app_name='user'
urlpatterns = [

    path('account/profile/', ProfileView.as_view(),name="profile"),
    path('signup/', register,name="signup"),
    path('login/', LoginView.as_view(template_name='login.html',form_class=MyLoginForm), name="login"),
    path('logout/', LogoutView.as_view(template_name='user/logged_out.html'), name="logout"),

    # user email varifications part
    path('profile/account_activation_sent',account_activation_sent.as_view(),name='account_activation_sent'),
    # path('active/account/<uidb64>/<token>/',activate,name='activate'),

    #Forget Password
    path('password-reset/',
        PasswordResetView.as_view(
        template_name='user/password_reset.html',
        subject_template_name='user/password_reset_subject.txt',
        email_template_name='user/password_reset_email.html',
        form_class=PasswordResetForm,
        success_url = reverse_lazy('user:password_reset_done'),
        ),name="password_reset"),
    path('password-reset/done/', PasswordResetDoneView.as_view(template_name='user/password_reset_done.html'), name="password_reset_done"),
    path('password-reset-confirm/<uidb64>/<token>/',PasswordResetConfirmViewCoustom.as_view(),name='password_reset_confirm'),
    path('password-reset/complete/', PasswordResetCompleteView.as_view(template_name='user/password_reset_complete.html'), name="password_reset_complete"),
    path("send-messages/",sendMessagesTo,name="sendmessages"),



]
Пример #13
0
             template_name='registration/change_password.html'),
         name='password_change'),
    path('accounts/password_change/done/',
         PasswordChangeDoneView.as_view(
             template_name='registration/password_changed.html'),
         name='password_change_done'),
    path('accounts/password_reset/',
         PasswordResetView.as_view(
             template_name='registration/reset_password.html',
             subject_template_name='registration/reset_subject.txt',
             email_template_name='registration/reset_email.html'),
         name='password_reset'),
    path('accounts/password_reset_done',
         PasswordResetDoneView.as_view(
             template_name='registration/email_sent.html'),
         name='password_reset_done'),
    path('accounts/reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='registration/confirm_password.html'),
         name='password_reset_confirm'),
    path('accounts/reset/done',
         PasswordResetCompleteView.as_view(
             template_name='registration/password_confirmed.html'),
         name='password_reset_complete'),
    path('captcha/', include('captcha.urls')),
    path('', include('social_django.urls')),
]
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Пример #14
0
        name="password_change_done"),
    re_path(r"^password_reset/$",
            PasswordResetView.as_view(
                form_class=CustomPasswordResetForm,
                success_url=reverse_lazy("accounts:password_reset_done"),
                extra_context={"section": "dashboard"}),
            name="password_reset"),
    re_path(
        r"^password_reset/done/$",
        PasswordResetDoneView.as_view(extra_context={"section": "dashboard"}),
        name="password_reset_done"),
    re_path(r"^reset/(?P<uidb64>\w+)/(?P<token>[\d\w-]+)/$",
            PasswordResetConfirmView.as_view(
                success_url=reverse_lazy("accounts:password_reset_complete"),
                extra_context={"section": "dashboard"}),
            name="password_reset_confirm"),
    re_path(r"^reset/done/$",
            PasswordResetCompleteView.as_view(
                extra_context={"section": "dashboard"}),
            name="password_reset_complete"),
    re_path(r"^register_confirm/(?P<uidb64>\d+)/(?P<token>[\w\d-]+)/$",
            register_confirm_view,
            name="register_confirm"),
    re_path(r"^user/edit/$", edit_profile_view, name="profile_edit"),
    re_path(r"^user/(?P<user_id>\d+)/$", profile_view, name="profile"),
    re_path(r"^remove_friend/(?P<user_id>\d+)/$",
            remove_friend,
            name="remove_friend"),
    re_path(r"^add_friend/(?P<user_id>\d+)/$", add_friend, name="add_friend"),
]
Пример #15
0
      LogoutView.as_view(template_name="app_user/logout.html"),
      name="logout"),
 path('password-reset/',
      PasswordResetView.as_view(
          template_name="app_user/password_reset.html"),
      name="password_reset"),
 path('password-reset/done/',
      PasswordResetDoneView.as_view(
          template_name="app_user/password_reset_done.html"),
      name="password_reset_done"),
 path('password-reset-confirm/<uidb64>/<token>/',
      PasswordResetConfirmView.as_view(
          template_name="app_user/password_reset_confirm.html"),
      name="password_reset_confirm"),
 path('password-reset-complete/',
      PasswordResetCompleteView.as_view(
          template_name="app_user/password_reset_complete.html"),
      name="password_reset_complete"),
 path('index/', user_views.viewindex, name='index'),
 path('profile_update_host/',
      user_views.profile_update_host,
      name='profile_update_host'),
 path('profile_update_host2/',
      user_views.profile_update_host2,
      name='profile_update_host2'),
 path('profile_update_host3/',
      user_views.profile_update_host3,
      name='profile_update_host3'),
 path('space_add/', user_views.space_add, name='space_add'),
 path('space_update/<int:space_id>/',
      user_views.space_update,
      name='space_update'),
Пример #16
0
from django.conf.urls import url
from django.contrib.auth.views import \
    PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, \
    PasswordResetCompleteView, LoginView, LogoutView

from comandes import views

urlpatterns = [
    url(r'^$', views.index, name='index'),
    url(r'^fer_comanda', views.fer_comanda, name='fer_comanda'),
    url(r'^esborra_comanda', views.esborra_comanda, name='esborra_comanda'),
    url(r'^comandes', views.veure_comandes, name='comandes'),
    url(r'^informe_proveidors', views.informe_proveidors, name='informe_proveidors'),
    url(r'^informe_caixes', views.informe_caixes, name='informe_caixes'),
    url(r'^test_email', views.test_email, name="test_email"),
    url(r'^recuperar_contrasenya/$', PasswordResetView.as_view(), name="recuperar_contrasenya"),
    url(r'^password_reset/$', PasswordResetView.as_view(), name="password_reset"),
    url(r'^password_reset_done/$', PasswordResetDoneView.as_view(), name="password_reset_done"),
    url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$', PasswordResetConfirmView.as_view(), name="password_reset_confirm"),
    url(r'^password_reset_complete/$', PasswordResetCompleteView.as_view(), name="password_reset_complete"),
    url(r'^afegeix_proveidors/', views.afegeix_proveidors, name="afegeix_proveidors" ),
    url(r'^distribueix_productes/(?P<data_recollida>[0-9-]+)/(?P<producte>\w{0,50})/$', views.distribueix_productes, name="distribueix_productes" ),
    url(r'^accounts/login/$', LoginView.as_view(template_name='login.html'), name='login'),
    url(r'^accounts/logout/$', LogoutView.as_view(next_page='/')),
    #{'next_page': '/'}),
]

#http://stackoverflow.com/questions/21284672/django-password-reset-password-reset-confirm
# change SITE_ID in settings.py
Пример #17
0
# Add Dask Dashboard Url
admin_urls = admin.site.urls
admin_urls[0].append(url(r'^dask-dashboard/(?P<page>[\w-]+)/(?P<dask_scheduler_id>[\w-]+)/$',
                         tethys_dask_views.dask_dashboard, name='dask_dashboard'))

account_urls = [
    url(r'^login/$', tethys_portal_accounts.login_view, name='login'),
    url(r'^logout/$', tethys_portal_accounts.logout_view, name='logout'),
    url(r'^register/$', tethys_portal_accounts.register, name='register'),
    url(r'^password/reset/$', PasswordResetView.as_view(), {'post_reset_redirect': '/accounts/password/reset/done/'},
        name='password_reset'),
    url(r'^password/reset/done/$', PasswordResetDoneView.as_view()),
    url(r'^password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', PasswordResetConfirmView.as_view(),
        {'post_reset_redirect': '/accounts/password/done/'}, name='password_confirm'),
    url(r'^password/done/$', PasswordResetCompleteView.as_view()),
]

user_urls = [
    url(r'^$', tethys_portal_user.profile, name='profile'),
    url(r'^settings/$', tethys_portal_user.settings, name='settings'),
    url(r'^change-password/$', tethys_portal_user.change_password, name='change_password'),
    url(r'^disconnect/(?P<provider>[\w.@+-]+)/(?P<association_id>[0-9]+)/$', tethys_portal_user.social_disconnect,
        name='disconnect'),
    url(r'^delete-account/$', tethys_portal_user.delete_account, name='delete'),
]

developer_urls = [
    url(r'^$', tethys_portal_developer.home, name='developer_home'),
    url(r'^gizmos/', include(('tethys_gizmos.urls', 'gizmos'), namespace='gizmos')),
    url(r'^services/', include(('tethys_services.urls', 'services'), namespace='services')),
Пример #18
0
from django.contrib.auth.views import (
    logout_then_login, redirect_to_login,
    PasswordResetView, PasswordResetDoneView,
    PasswordChangeView, PasswordChangeDoneView,
    PasswordResetConfirmView, PasswordResetCompleteView
)

urlpatterns = [
    url(r'^login/$', login),
    url(r'^caslogin/$', caslogin, {}, 'cas-login'),
    url(r'^logout/$', logout),

    url(r'^logout_then_login/$', logout_then_login),
    url(r'^redirect_to_login/$', redirect_to_login),

    url('^password_change/done/', PasswordChangeDoneView.as_view(),
        name='password_change_done'),
    url('^password_change/', PasswordChangeView.as_view(),
        name='password_change'),

    url('^password_reset/done/', PasswordResetDoneView.as_view(),
        name='password_reset_done'),
    url('^password/reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/',
        PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    url('^password/reset/complete/',
        PasswordResetCompleteView.as_view(),
        name='password_reset_complete'),
    url('^password_reset/', PasswordResetView.as_view(),
        name='password_reset')
]
Пример #19
0
    # path('accounts/login/', LoginView.as_view(template_name='index.html'), name='accounts_login'),    
    path('login/', LoginView.as_view(template_name='accounts/login.html'),name='login'),
    path('logout/', LogoutView.as_view(template_name='accounts/logout.html'),name='logout'),            
    path('register/', SignUpView.as_view(success_url=reverse_lazy('login')),name='register'),            
    # url(r'^register/$', register, name='register'),
    url(r'^profile/$', view_profile, name='view_profile'),
    url(r'^profile/(?P<pk>\d+)/$', view_profile, name='view_profile_with_pk'),
    url(r'^profile/edit/$', edit_login_profile, name='edit_login_profile'),
    url(r'profile/update/$',UserProfileUpdateView.as_view(), name='edit_user_profile'),
    url(r'^change-password/$', change_password, name='change_password'),
    
    re_path(r'^reset-password/$', PasswordResetView.as_view(template_name='accounts/reset_password.html'),name='reset_password'),
    
    re_path(r'^reset-password/confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$',PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    
    path('reset-password/complete/', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
    
    path('reset-password/completes/', PasswordResetDoneView.as_view(), name='password_reset_complete'),
    
]
 
 # Tasks
urlpatterns += [
    path('tasks/<int:pk>', TaskDetail.as_view(), name='task_detail'),
    path('tasks/create', CreateTask.as_view(success_url=reverse_lazy('dashboard')), name='create_task'),
    path('tasks/<int:pk>/edit', EditTask.as_view(),name='edit_task'),
    path('tasks/<int:pk>/update', UpdateTask.as_view(),name='update_task'),  # TODO: need to specify task ID somewhere    
    path('tasks/<int:pk>/delete', DeleteTask.as_view(success_url=reverse_lazy('dashboard')),name='delete_task'),
    path('dashboard', DashboardView.as_view(), name='dashboard'),
    path('test', TestPreCreateTask.as_view(), name='pre_create_task'),
    path('test/<int:pk>', TestCreateTask.as_view(), name='create_task_with_team_id'),
Пример #20
0
	
    path('',views.post_list,name='post_list'),
	path('home/',views.home,name='home'),
	path('post_new/',views.post_new,name='post_new'),
	
    path('login/',LoginView.as_view(),name='login'),
    path('myblogs/',views.myblogs,name='myblogs'),
    #path('password_reset/', ,name='password_reset'),
    path('signup/',views.signup, name='signup'),
    path('logout/',views.log_out,name='logout'),
    #path('logout/', views.LogoutView.as_view(), name='logout'),

    path('password-reset/', PasswordResetView.as_view(template_name='blog/password_reset_form.html',
        subject_template_name='blog/password-reset/password_reset_subject.txt',email_template_name='blog/password-reset/password_reset_email.html'),name='password_reset'),
    path('password_reset/done/', PasswordResetDoneView.as_view(template_name='blog/password-reset/password_reset_done.html'), name='password_reset_done'),
    #**for comment -----
    #path('comment/<int:pk>/approve/', views.comment_approve, name='comment_approve'), #for comment
    #path('comment/<int:pk>/remove/', views.comment_remove, name='comment_remove'),      #for comment
    path('reset/done/', PasswordResetCompleteView.as_view(template_name='blog/password-reset/password_reset_complete.html'), name='password_reset_complete'),
    path('reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(template_name='blog/password-reset/password_reset_confirm.html'), name='password_reset_confirm'),
    
    #path('post/<int:pk>/comment/', views.add_comment_to_post, name='add_comment_to_post'), #for comment
    #path('post/<int:pk>/reply/', views.reply, name='add_comment_to_post'),
    path('<int:pk>/edit/', views.post_edit, name='post_edit'),
    path('<int:pk>/detail/', views.post_detail, name='post_detail'),
    path('subscribe/',views.subscribe,name='subscribe'),
    #path('country/',include('country.urls'))
    #path('login/')

    path('oauth/', include('social_django.urls', namespace='social')),
]
Пример #21
0
        url(_(r'^reset/'), include([
            url(r'^$',
                view=PasswordResetView.as_view(
                    form_class=SystemPasswordResetRequestForm,
                    html_email_template_name='email/password_reset.html',
                    email_template_name='email/password_reset.txt',
                    subject_template_name='email/password_reset_subject.txt',
                ),
                name='password_reset'),
            url(_(r'^sent/$'), view=PasswordResetDoneView.as_view(), name='password_reset_done'),
            url(r'^(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
                view=PasswordResetConfirmView.as_view(
                    form_class=SystemPasswordResetForm,
                ),
                name='password_reset_confirm'),
            url(_(r'^done/$'), view=PasswordResetCompleteView.as_view(), name='password_reset_complete'),
        ])),
    ])),
    # Backwards-compatibility for older password reset URLs. They become invalid
    # quickly, so can be removed after 31 Dec 2017.
    url(_(r'^reset-password/(?P<uidb64>.+?)/(?P<token>.+?)/$'),
        RedirectView.as_view(pattern_name='password_reset_confirm', permanent=True)),
    url(_(r'^username/$'), UsernameChangeView.as_view(), name='username_change'),
    url(_(r'^email/'), include([
        url(r'^$', EmailUpdateView.as_view(), name='email_update'),
        url(_(r'^verify/$'), EmailVerifyView.as_view(), name='email_verify'),
    ])),

    url(_(r'^admin/'), include([
        url(_(r'^mass-mail/'), include([
            url(r'^$', MassMailView.as_view(), name='mass_mail'),
Пример #22
0
from django.urls import path
from django.contrib.auth.views import LogoutView, PasswordResetDoneView, PasswordResetCompleteView

from .views import SignUpView, ActivateAccountView, PasswordResetView, PasswordResetConfirmView, UserDeletionView, \
    LoginView, SignupSuccessView

app_name = 'custom_user'

urlpatterns = [
    path('signup/', SignUpView.as_view(), name='signup'),
    path('login/', LoginView.as_view(template_name='custom_user/login.html'), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('delete-account/', UserDeletionView.as_view(), name='delete_user'),
    path('activate/<uidb64>/<token>', ActivateAccountView.as_view(), name='activate'),

    # password reset views
    path('password-reset/', PasswordResetView.as_view(), name='password_reset'),
    path('password-reset-asked/', PasswordResetDoneView.as_view(template_name='custom_user/password_reset_asked.html'),
         name='password_reset_asked'),
    path('set-new-password/<uidb64>/<token>', PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('password-reset-completed/',
         PasswordResetCompleteView.as_view(template_name='custom_user/password_reset_completed.html'),
         name='password_reset_done'),

    # message views
    path('message/signup-success', SignupSuccessView.as_view(), name='message_signup_success'),
]
Пример #23
0
from django.conf.urls import url
from django.urls import path
from . import views
from django.contrib.auth.views import LogoutView, LoginView, PasswordChangeView, PasswordChangeDoneView
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetCompleteView, PasswordResetDoneView
from django.conf import settings



app_name = 'account'

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('dashboard/', views.dashboard, name='dashboard'),
    path('password-change/done/', PasswordChangeDoneView.as_view(), name='password_change_done'),
    path('password-change/', PasswordChangeView.as_view(), name='password_change'),
    path('password-reset/done/', PasswordResetDoneView.as_view(), name='password_reset_done'),
    path('password-reset/complete/', PasswordResetCompleteView.as_view(), name='password_reset_confirm'),
    path('password-reset/done/', PasswordResetDoneView.as_view(), name='password_reset_complete'),
    path('password-reset/', PasswordResetView.as_view(), name='password_reset'),
]
Пример #24
0
def password_reset_complete(request):
    context = dict()

    return PasswordResetCompleteView.as_view(
        extra_context=context,
        template_name="accounts/password_reset_complete.html")(request=request)
Пример #25
0
from django.urls import path, reverse_lazy
from django.contrib.auth.views import (
    PasswordResetView, PasswordResetDoneView, 
    PasswordResetConfirmView, PasswordResetCompleteView
)
from .forms import PasswordResetForm, PasswordConfirmForm
from .views import *
from users import views

app_name = 'users'
urlpatterns = [
    path('login', LoginView.as_view(), name = "login"),
    path('logout', LogoutView.as_view(), name = "logout"),
    path('register', RegisterView.as_view(), name = "register"),
    path('update/<int:pk>', PerfilUpdate.as_view(), name = "update"),
    path('update_profile/<int:pk>', UserPerfilUpdate.as_view(), name = "update_user"),
    path('change_password/', ChangePasswordView.as_view(), name = "change_password"),
    path('constancia-trabajo', ConstanciaPdf.as_view(), name = "constancia"),
    path('password/reset/',PasswordResetView.as_view(
        template_name='user.reset.html',
        form_class=PasswordResetForm,
        success_url='/password/done/',
        email_template_name="email.password.recover.html"), name="reset"),
    path('password/done/',PasswordResetDoneView.as_view(
        template_name="user.passwordreset.done.html"),name="rest_done"),
    path('password/reset/<str:uidb64>/<str:token>/',PasswordResetConfirmView.as_view(
        template_name="user.passwordreset.confirm.html",
        success_url="/password/done"),name="password_reset_confirm"),
    path('password/done',PasswordResetCompleteView.as_view(
        template_name="user.passwordreset.end.html"),name='password_done')
]
Пример #26
0
         zerver.views.auth.password_reset,
         name='zerver.views.auth.password_reset'),
    path(
        'accounts/password/reset/done/',
        PasswordResetDoneView.as_view(
            template_name='zerver/reset_emailed.html')),
    re_path(
        r'^accounts/password/reset/(?P<uidb64>[0-9A-Za-z]+)/(?P<token>.+)/$',
        PasswordResetConfirmView.as_view(
            success_url='/accounts/password/done/',
            template_name='zerver/reset_confirm.html',
            form_class=zerver.forms.LoggingSetPasswordForm),
        name='django.contrib.auth.views.password_reset_confirm'),
    path(
        'accounts/password/done/',
        PasswordResetCompleteView.as_view(
            template_name='zerver/reset_done.html')),
    path('accounts/deactivated/',
         zerver.views.auth.show_deactivation_notice,
         name='zerver.views.auth.show_deactivation_notice'),

    # Displays digest email content in browser.
    path('digest/', zerver.views.digest.digest_page),

    # Registration views, require a confirmation ID.
    path('accounts/home/',
         zerver.views.registration.accounts_home,
         name='zerver.views.registration.accounts_home'),
    re_path(r'^accounts/send_confirm/(?P<email>[\S]+)?$',
            TemplateView.as_view(
                template_name='zerver/accounts_send_confirm.html'),
            name='signup_send_confirm'),
Пример #27
0
def password_reset_complete(request, extra_context=None):
    return PasswordResetCompleteView.as_view(**view_defaults())(request)
Пример #28
0
    path('login/',
         LoginView.as_view(template_name='accounts/login.html'),
         name='login'),
    path('logout/',
         LogoutView.as_view(template_name='accounts/logout.html'),
         name='logout'),
    path('register/', register, name='register'),
    path('profile/', view_profile, name='view_profile'),
    path('profile/edit/', edit_profile, name='edit_profile'),
    path('change-password', change_password, name='change_password'),
    path('reset-password',
         PasswordResetView.as_view(
             template_name='accounts/reset_password.html',
             email_template_name='accounts/reset_password_email.html',
             success_url=reverse_lazy('accounts:password_reset_done')),
         name='reset_password'),
    path('reset-password/done',
         PasswordResetDoneView.as_view(
             template_name='accounts/reset_password_done.html'),
         name='password_reset_done'),
    path('reset-password/confirm/<uidb64>/<token>',
         PasswordResetConfirmView.as_view(
             template_name='accounts/reset_password_confirm.html',
             success_url=reverse_lazy('accounts:password_reset_complete')),
         name='password_reset_confirm'),
    path('reset/done',
         PasswordResetCompleteView.as_view(
             template_name='accounts/reset_password_complete.html'),
         name='password_reset_complete'),
]
Пример #29
0
from django.conf.urls import include, url
from django.contrib import admin
# We load them here to override their template.
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, \
    PasswordResetCompleteView, LoginView, LogoutView
from django.views.generic import RedirectView

from webview.views import settings

urlpatterns = [
    url(r'^favicon\.ico$', RedirectView.as_view(url='/public/img/favicon.ico')),  # serve the favicon and avoid 404s
    url(r'^', include('webview.urls')),
    url(r'^jet/', include('jet.urls', 'jet')),  # Django JET URLS
    url(r'^jet/dashboard/', include('jet.dashboard.urls', 'jet-dashboard')),  # Django JET dashboard URLS
    url(r'^admin/doc/', include('django.contrib.admindocs.urls')),
    url(r'^admin/', admin.site.urls),  # add admin
    url(r'^login/', LoginView.as_view(template_name='login.html'), name='login'),  # override the template with ours
    url(r'^logout/', LogoutView.as_view(template_name='loggedout.html'), name='logout'),  # override the template with ours
    url(r'^password_reset/', PasswordResetView.as_view(template_name='lostpass.html'), name='password_reset'),
    url(r'^password_reset_done/',
        PasswordResetDoneView.as_view(template_name='resetdone.html'), name='password_reset_done'),
    url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        PasswordResetConfirmView.as_view(template_name='resetconfirm.html', success_url='/'),
        name='password_reset_confirm'),  # override the template with ours
    url(r'^password_reset_complete/', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
    # override the template with ours
    url(r'^settings/', settings, name='settings')
    # url(r'^500/$', 'django.views.defaults.server_error'),
]
Пример #30
0
from django.contrib.auth.views import LoginView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    path('', views.index, name='index'),
    path('Registro', views.Registro, name='Registro'),
    path('foro', views.foro, name='foro'),
    path('Download', views.Download, name='Download'),
    path('Devs', views.Devs, name='Devs'),
    path('Juego', views.Juego, name='Juego'),
    path('Desarrollo', views.Desarrollo, name='Desarrollo'),
    path('permiso', views.permiso, name='permiso'),

    path('login', LoginView.as_view(), name='login'),

    path('password_reset_form', PasswordResetView.as_view(template_name='registration/password_reset_form.html', email_template_name="registration/password_reset_email.html"), name = 'password_reset'),

    path('password_reset_done', PasswordResetDoneView.as_view(template_name='registration/password_reset_done.html'), name = 'password_reset_done'),

    re_path(r'^reset/(?P<uidb64>[0-9A-za-z_\-]+)/(?P<token>.+)/$', PasswordResetConfirmView.as_view(template_name='registration/password_reset_confirms.html'), name = 'password_reset_confirm'),
    
    path('password_reset_complete',PasswordResetCompleteView.as_view(template_name='registration/password_reset_complete.html') , name = 'password_reset_complete'),

    path('post/<int:pk>/', views.post_detail, name='post_detail'),
    path('post/new', views.post_new, name='post_new'),
    path('post/<int:pk>/edit/', views.post_edit, name='post_edit'),
    #api
    url(r'^api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
    #---fin api
]
Пример #31
0
    # password reset
    path(
        'password-reset/',
        PasswordResetView.as_view(
            template_name='Registration_App/Users_Password_Reset_Template.html',
            success_url=reverse_lazy('Registration_App:password_reset_done'),
        ),
        name='password_reset'),
    path('password-reset-done/',
         PasswordResetDoneView.as_view(
             template_name=
             'Registration_App/Users_Password_Reset_Done_Template.html', ),
         name='password_reset_done'),

    # password reset comfirm
    # path(
    #     'password-reset-confirm/<uidb64>/<token>/',
    #     PasswordResetConfirmView.as_view(
    #         template_name='Registration_App/Users_Password_Reset_Confirm_Template.html',
    #         success_url=reverse_lazy(
    #             'Registration_App:password_reset_complete'),
    #     ),
    #     name='password_reset_confirm'
    # ),
    path('password-reset-complete/',
         PasswordResetCompleteView.as_view(
             template_name=
             'Registration_App/Users_Password_Reset_Complete_Template.html'),
         name='password_reset_complete'),
]
Пример #32
0
    path('login/', 
        LoginView.as_view(template_name = 'users/login.html', redirect_authenticated_user = True), 
        name = 'login'),
    
    path("password-reset/",
     	PasswordResetView.as_view(template_name='users/password_reset.html'),
    	name="password_reset"),

	path("password-reset/done/", 
		PasswordResetDoneView.as_view(template_name='users/password_reset_done.html'), 
		name="password_reset_done"),

	path("password-reset-confirm/<uidb64>/<token>/", 
		PasswordResetConfirmView.as_view(template_name='users/password_reset_confirm.html'), 
		name="password_reset_confirm"),

	path("password-reset-complete/", 
		PasswordResetCompleteView.as_view(template_name='users/password_reset_complete.html'), 
		name="password_reset_complete"),
]




    
    
    


Пример #33
0
    url(r'^confirm/(?P<email_auth_token>([a-z]|[0-9]){14})/$',
        views.confirm_email,
        name='confirm_email'),
    url(r'create$', views.create, name="create"),
    url(r'login$', views.login, name="login"),
    url(r'log_out$', views.log_out, name="log_out"),
    url(r'change_pwd$', views.navigate_change_pwd, name="change_pwd"),
    url(r'change_password$', views.change_password, name="change_password"),
    url(r'get_auth_token$', views.get_auth_token, name="get_auth_token"),
    url(r'revoke_auth_token$',
        views.revoke_auth_token,
        name="revoke_auth_token"),
    url(r'password_reset$',
        PasswordResetView.as_view(
            template_name='password-templates/password-form.html',
            email_template_name='password-templates/password-email.html'),
        name='password_reset'),
    url(r'password_reset_done/',
        PasswordResetDoneView.as_view(
            template_name='password-templates/password-reset-done.html'),
        name='password_reset_done'),
    url(r'password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        PasswordResetConfirmView.as_view(
            template_name="password-templates/password-reset-confirm.html"),
        name='password_reset_confirm'),
    url(r'password_reset_complete$',
        PasswordResetCompleteView.as_view(
            template_name='password-templates/password-reset-complete.html'),
        name='password_reset_complete'),
]
Пример #34
0
        context = super().get_email_context(activation_key)
        context["request"] = self.request
        return context

    def get_success_url(self, user):
        return reverse("accounts:signup_complete")

    def registration_allowed(self):
        return config.SIGNUP_ALLOWED


class ActivationView(HmacActivationView):
    template_name = "accounts/activation_failed.html"

    def get_success_url(self, user):
        return reverse("accounts:activation_complete")


activate = ActivationView.as_view()
activation_complete = TemplateView.as_view(template_name="accounts/activation_complete.html")
signup = SignupView.as_view()
signup_closed = TemplateView.as_view(template_name="accounts/signup_closed.html")
signup_complete = TemplateView.as_view(template_name="accounts/signup_complete.html")

password_reset = PasswordResetView.as_view(
    success_url=reverse_lazy("accounts:password_reset_done"))
password_reset_done = PasswordResetDoneView.as_view()
password_reset_confirm = PasswordResetConfirmView.as_view(
    success_url=reverse_lazy("accounts:password_reset_complete"))
password_reset_complete = PasswordResetCompleteView.as_view()
Пример #35
0
    path('profile/<int:id>/', views.profile, name='profile'),
    path('profile-edit/', views.profile_edit, name='profile_edit'),

    # Activate Account
    path('activate/<uidb64>/<token>/', ActivateAccount.as_view(), name='activate'),

    # Auth
    path('login/', LoginView.as_view(template_name='account/login.html'), name='login'),
    path('register/', views.register, name='register'),
    path('logout/', views.logout, name='logout'),

    # Forget Password
    path('password_reset/', PasswordResetView.as_view(template_name='password_change/password_reset_form.html',
                                                      email_template_name='password_change/password_reset_email.html',
                                                      success_url=reverse_lazy('user:password_reset_done')),
         name='password_reset'),
    path('password_reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(template_name='password_change/password_reset_confirm.html',
                                          success_url=reverse_lazy('user:password_reset_complete')),
         name='password_reset_confirm'),
    path('password_reset/done/',
         PasswordResetDoneView.as_view(template_name='password_change/password_reset_done.html'),
         name='password_reset_done'),
    path('password_reset/complete/',
         PasswordResetCompleteView.as_view(template_name='password_change/password_reset_complete.html'),
         name='password_reset_complete'),

    # Password Change
    path('password_change/', PasswordChange.as_view(), name='password_change'),
]
Пример #36
0
from django.conf.urls import include, url
from django.contrib import admin

from registration.backends.model_activation.views import RegistrationView
from django.contrib.auth.views import PasswordChangeView, PasswordResetView, PasswordResetConfirmView, PasswordResetCompleteView
from app.forms import RegistrationForm, PasswordChangeForm, PasswordResetForm, SetPasswordForm

admin.autodiscover()

admin.site.site_header = "CFA administration"

urlpatterns = [
    url(r'^admin/', admin.site.urls),
    url(r'^accounts/password/change/$', PasswordChangeView.as_view(form_class=PasswordChangeForm, success_url="done"), name='auth_password_change'),
    url(r'^accounts/password/reset/$', PasswordResetView.as_view(form_class=PasswordResetForm, success_url="done"), name='auth_password_reset'),
    url(r'^accounts/password/reset/confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        PasswordResetConfirmView.as_view(form_class=SetPasswordForm),
        name='password_reset_confirm'),
    url(r'^accounts/password/reset/complete/$', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
    url(r'^accounts/register/$', RegistrationView.as_view(form_class=RegistrationForm), name='registration_register'),
    url(r'^accounts/', include('registration.backends.model_activation.urls')),
    url(r'', include('app.urls')),
]
Пример #37
0
            template_name='accounts/password_reset/'
            'email_sent.html',
        ),
        name='password_reset_done'
    ),
    path(
        'password_reset_confirm/<uidb64>/<token>/',
        PasswordResetConfirmView.as_view(
            template_name='accounts/password_reset/'
            'password_reset_confirm.html',
            success_url=reverse_lazy('accounts:password_reset_complete')
        ),
        name='password_reset_confirm'
    ),
    path(
        'password_reset_complete/',
        PasswordResetCompleteView.as_view(
            template_name='accounts/password_reset/'
            'password_reset_complete.html',
        ),
        name='password_reset_complete'
    ),

    # Registration
    path(
        'registration/',
        RegistrationView.as_view(),
        name='registration'
    )
]
Пример #38
0
    PasswordResetDoneView,
    PasswordResetView,
    PasswordResetCompleteView
)
from django.urls import include, path

from leads.views import LandingPageView, SignUpView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', LandingPageView.as_view(), name="landing-page"),
    path('signup/', SignUpView.as_view(), name="signup"),
    path('login/', LoginView.as_view(), name="login"),
    path('logout/', LogoutView.as_view(), name="logout"),
    path('reset-password/', PasswordResetView.as_view(), name="password-reset"),
    path('password-reset-done/', PasswordResetDoneView.as_view(),
         name="password_reset_done"),
    path('password-reset-complete/', PasswordResetCompleteView.as_view(),
         name="password_reset_complete"),
    path('password-reset-confirm/<uidb64>/<token>',
         PasswordResetConfirmView.as_view(), name="password_reset_confirm"),
    path('leads/', include('leads.urls')),
    path('agents/', include('agents.urls')),
]

urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)

if settings.DEBUG:
    import debug_toolbar
    urlpatterns += [path('__debug__/', include(debug_toolbar.urls)), ]
Пример #39
0
urlpatterns = [
    path(settings.ADMIN_URL, admin.site.urls),
    path("api/", include(email_auth_urls)),
    path("api/", include("test_aws.core.urls")),
    path("api/", include("test_aws.user.urls")),
    re_path(
        r"^confirm-email/(?P<key>[-:\w]+)/$", ConfirmEmail.as_view(), name="account_confirm_email"
    ),
    re_path(
        r"^password-reset/(?P<uidb64>[0-9A-Za-z_\-]+)/"
        "(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$",
        PasswordResetConfirmView.as_view(),
        name="password_reset_confirm",
    ),
    path(
        "password-reset/done/", PasswordResetCompleteView.as_view(), name="password_reset_complete"
    ),
]


if settings.SWAGGER_ENABLED:
    urlpatterns += [
        re_path(
            r"swagger(?P<format>\.json|\.yaml)$",
            schema_view.without_ui(cache_timeout=0),
            name="schema-json",
        ),
        path("swagger/", schema_view.with_ui("swagger", cache_timeout=0), name="schema-swagger-ui"),
        path("redoc/", schema_view.with_ui("redoc", cache_timeout=0), name="schema-redoc"),
        path("swagger-auth/", include("rest_framework.urls", "swagger-auth")),
    ]
Пример #40
0
from django.conf.urls import url

from . import views
from django.contrib.auth.views import PasswordResetConfirmView, PasswordResetView, PasswordResetDoneView, PasswordResetCompleteView

urlpatterns = [
    url(r'^$', views.index,name="home"),
    url(r'update$', views.update, name='update'),
    url(r'^confirm/(?P<email_auth_token>([a-z]|[0-9]){14})/$', views.confirm_email, name='confirm_email'),
    url(r'create$', views.create, name="create"),
    url(r'login$', views.login, name="login"),
    url(r'log_out$', views.log_out, name="log_out"),
    url(r'change_password$', views.change_password, name="change_password"),
    url(r'get_auth_token$', views.get_auth_token, name="get_auth_token"),
    url(r'revoke_auth_token$', views.revoke_auth_token, name="revoke_auth_token"),
    url(r'password_reset$', PasswordResetView.as_view(template_name='password-templates/password-form.html',email_template_name='password-templates/password-email.html'), name='password_reset'),
    url(r'password_reset_done/', PasswordResetDoneView.as_view(template_name='password-templates/password-reset-done.html'), name='password_reset_done'),
    url(r'password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        PasswordResetConfirmView.as_view(template_name="password-templates/password-reset-confirm.html"),
        name='password_reset_confirm'),
    url(r'password_reset_complete$', PasswordResetCompleteView.as_view(template_name='password-templates/password-reset-complete.html'), name='password_reset_complete'),
    ]   
Пример #41
0
             success_url="/account/password-change-done"),
         name='password_change'),  #内置修改密码视图,这里始终报错,未解决;实际上是密码修改成功,只是无法跳转到相应的网页
    path('password-change-done/',
         PasswordChangeDoneView.as_view(),
         name='password_change_done'),  #内置修改密码视图
    path('password-reset/',
         PasswordResetView.as_view(
             template_name="account/password_reset_form.html",
             email_template_name="account/password_reset_email.html",
             subject_template_name="account/password_reset_subject.txt",
             success_url="account/password-reset-done",
             from_email="*****@*****.**"),
         name="password_reset"),
    path('password-reset-done',
         PasswordResetDoneView.as_view(
             template_name="account/password_reset_done.html"),
         name="password_reset_done"),
    path('password-reset-confirm/<uid64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name="account/password_reset_confirm.html",
             success_url="password_reset_complete"),
         name="password_reset_confirm"),
    path('password-reset-complete/',
         PasswordResetCompleteView.as_view(
             template_name="account/password_reset_complete.html"),
         name="password_reset_complete"),
    path('my-information/', views.myself, name="my_information"),
    path('edit-my-information/', views.myself_edit,
         name="edit_my_information"),
    path('my-image/', views.my_image, name="my_image"),
]
Пример #42
0
# -*- coding: utf-8 -*-
from django.conf.urls import url
from django.contrib.auth.views import LoginView, LogoutView, \
    PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = (
    # login and logout url
    url(r'^login/$', LoginView.as_view(template_name='login.html'), name='login'),
    # or use logout with template 'logout.html'
    url(r'^logout/$', LogoutView.as_view(), name='logout'),

    # password reset urls
    url(r'^password_reset/$',
        PasswordResetView.as_view(template_name='password_reset.html'),
        name='password_reset'),
    url(r'^password_reset_done/$',
        PasswordResetDoneView.as_view(template_name='password_reset_done.html'),
        name='password_reset_done'),
    url(r'^password_reset_confirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
        PasswordResetConfirmView.as_view(template_name='password_reset_confirm.html'),
        name='password_reset_confirm'),
    url(r'^password_reset_complete/$',
        PasswordResetCompleteView.as_view(template_name='password_reset_complete.html'),
        name='password_reset_complete'),
)
Пример #43
0
from django.conf.urls import url
from django.contrib.auth.views import (
    LogoutView, PasswordResetCompleteView, PasswordResetConfirmView, PasswordResetDoneView, PasswordResetView
)
from django.views.generic import TemplateView

from accounts.views import RegisterAccountView, SettingsView


urlpatterns = [
    url(r'^logout/?$', LogoutView.as_view(next_page='/'), name='logout'),
    url(r'^register/?$', RegisterAccountView.as_view(), name='register'),
    url(r'^settings/?$', SettingsView.as_view(), name='settings'),

    url(r'^password/reset/sent/?$', PasswordResetDoneView.as_view(), name='password_reset_done'),
    url(r'^password/reset/complete/?$', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
    url(
        r'^password/reset/(?P<uidb64>[0-9A-Za-z_-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/?$',
        PasswordResetConfirmView.as_view(),
        name='password_reset_confirm'
    ),
    url(r'^password/reset/?$', PasswordResetView.as_view(), name='password_reset'),

    url(
        r'^error/email-required/?$',
        TemplateView.as_view(template_name='registration/error/email-required.html'),
        name='error_email_required'
    ),
    url(
        r'^error/account-exists/?$',
        TemplateView.as_view(template_name='registration/error/account-exists.html'),