Пример #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)

urlpatterns = [
    path('', PasswordResetView.as_view(), name='password_reset'),
    path('done/', PasswordResetDoneView.as_view(), name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('complete',
         PasswordResetCompleteView.as_view(),
         name='password_reset_complete')
]
Пример #4
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')
]
Пример #5
0
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.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.auth.views import (
    LoginView, LogoutView,
    PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
)
from django.urls import path, include
from leads.views import LeadListView
from authentication.views import SignupView

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

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
Пример #6
0
from usuarios.views import RegistrarUsuarioView

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', views.index, name='index'),
    path('perfil/<int:perfil_id>', views.exibir_perfil, name='exibir'),
    path('perfil/<int:perfil_id>/convidar', views.convidar, name='convidar'),
    path('convite/<int:convite_id>/aceitar', views.aceitar, name='aceitar'),
    path('convite/<int:convite_id>/recusar', views.recusar, name='recusar'),
    path('convite/<int:perfil_id>/desfazer', views.desfazer_amizade, name='desfazer'),
    path('registrar/', RegistrarUsuarioView.as_view(), name="registrar"),
    path('logout/', auth_views.LogoutView.as_view(template_name = 'login.html'), name="logout"),
    path('login/', auth_views.LoginView.as_view(template_name='login.html'), name="login"),
    path('mudar-senha/', views.mudar_senha, name="mudar_senha"),
    path('timeline/', include('timeline.urls'), name="timeline"),
    path('perfil/<int:perfil_id>/super', views.definirSuperUser, name='super'),
    #path('perfil/post_new', views.post_new, name='post_new'),
    path('perfil/pesquisar', views.PesquisarPerfilView.as_view(), name='pesquisar'),
    path('password_reset/$', PasswordResetView.as_view(template_name='reset_form.html'),
         name='password_reset'),
    path('password_reset/done/', PasswordResetDoneView.as_view(template_name='reset_email.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(template_name='reset_confirm.html'),
         name='password_reset_confirm'),
    path('reset/done/$', PasswordResetCompleteView.as_view(template_name='reset_password.html'),
         name='password_reset_complete'),
]


Пример #7
0
def password_reset_done(request, extra_context=None):
    return PasswordResetDoneView.as_view(**view_defaults())(request)
Пример #8
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()
Пример #9
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
Пример #10
0
 def test_PasswordResetDoneView(self):
     response = PasswordResetDoneView.as_view()(self.request)
     self.assertContains(response, '<title>Password reset sent</title>')
     self.assertContains(response, '<h1>Password reset sent</h1>')
Пример #11
0
def password_reset_done(request):
    context = dict()

    return PasswordResetDoneView.as_view(
        extra_context=context,
        template_name="accounts/password_reset_done.html")(request=request)
Пример #12
0
         name='drug_update'),
    path('manage/drugs/add/', add_drug, name='add_drug'),
    path('manage/drugs/', DrugListView.as_view(), name='drugs'),
    path('profile/', profile, name='profile'),
    path('manage/register/', register, name='register'),
    path('admin/', admin.site.urls, name='admin'),
    path('', home_view, name='home'),
    path('login/',
         LoginView.as_view(template_name='components/login.html'),
         name='login'),
    path('logout/',
         LogoutView.as_view(template_name='components/logout.html'),
         name='logout'),
    path('password-reset/',
         PasswordResetView.as_view(
             template_name='components/password_reset.html'),
         name='password_reset'),
    path('password-reset/done/',
         PasswordResetDoneView.as_view(
             template_name='components/password_reset_done.html'),
         name='password_reset_done'),
    path('password-reset-confirm/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='components/password_reset_confirm.html'),
         name='password_reset_confirm'),
]

#This line ensures that media files are stored and accessed differently during development. Once production starts, debug mode will end and this line will be ignored
if settings.DEBUG:
    urlpatterns += static(settings.MEDIA_URL,
                          document_root=settings.MEDIA_ROOT)
Пример #13
0
    path('logout/',
         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'),
]
Пример #14
0
    path('things/', RedirectView.as_view(pattern_name='browse', permanent=True)),
    path('things/<slug>/', views.thing_detail, name='thing_detail'),
    path('things/<slug>/edit/', views.edit_thing, name='edit_thing'),

    path('browse/', RedirectView.as_view(pattern_name='browse', permanent=True)),
    path('browse/name/',
        views.browse_by_name, name='browse'),
    path('browse/name/<initial>/',
        views.browse_by_name, name='browse_by_name'),

    path('accounts/password/reset/',
        PasswordResetView.as_view(template_name='registration/password_reset_form.html'),
        name='password_reset'),
    path('accounts/password/reset/done/',
        PasswordResetDoneView.as_view(template_name='registration/password_reset_done.html'),
        name='password_reset_done'),
    path('accounts/password/reset/<uidb64>/<token>/',
        PasswordResetConfirmView.as_view(template_name='registration/password_reset_confirm.html'),
        name='password_reset_confirm'),
    path('accounts/password/done/',
        PasswordResetDoneView.as_view(template_name='registration/password_reset_complete.html'),
        name='password_reset_complete'),

    path('accounts/register/',
        MyRegistrationView.as_view(), name='registration_register'),
    path('accounts/create_thing/',
        views.create_thing, name='registration_create_thing'),

    path('accounts/', include('registration.backends.simple.urls')),
    path('admin/', admin.site.urls),
Пример #15
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()
Пример #16
0
         name='portal'),
    path('books/', RedirectView.as_view(pattern_name='browse',
                                        permanent=True)),
    path('books/<slug>/', views.book_detail, name='book_detail'),
    # path('books/<slug>/edit/', views.edit_entry, name='edit_entry'),
    path('browse/', RedirectView.as_view(pattern_name='browse',
                                         permanent=True)),
    path('browse/title/', views.browse_by_title, name='browse'),
    path('browse/title/<initial>/',
         views.browse_by_title,
         name='browse_by_title'),
    path('accounts/password/reset/',
         PasswordResetView.as_view(
             template_name='registration/pw_reset_form.html'),
         name="password_reset"),
    path('accounts/password/reset/done/',
         PasswordResetDoneView.as_view(
             template_name='registration/pw_reset_done.html'),
         name="password_reset_done"),
    path('accounts/password/reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='registration/pw_reset_confirm.html'),
         name="password_reset_confirm"),
    path('accounts/password/done/',
         PasswordResetCompleteView.as_view(
             template_name='registration/pw_reset_complete.html'),
         name="password_reset_complete"),
    path('accounts/', include('registration.backends.simple.urls')),
    path('admin/', admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #17
0
admin.autodiscover()
admin.site.login = staff_member_required(admin.site.login, redirect_field_name="", login_url='/accounts/login/')

# 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 = [
Пример #18
0
Class-based views
    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
from django.urls import include
from django.conf.urls.static import static
from django.conf import settings
from django.contrib.auth import views as auth_views
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView


urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('home.urls')),
    path('accounts/', include('accounts.urls')),

    path('reset-password', PasswordResetView.as_view(), name='password_reset'),
    path('reset-password/done', PasswordResetDoneView.as_view(), name='password_reset_done'),
    path('reset-password/confirm/<uidb64>/<token>/', PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('reset-password/complete/', PasswordResetCompleteView.as_view(),name='password_reset_complete'),

]
urlpatterns = urlpatterns + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Пример #19
0
 # We have two entries for accounts/login; only the first one is
 # used for URL resolution.  The second here is to allow
 # reverse("login") in templates to
 # return `/accounts/login/`.
 path("accounts/login/",
      login_page, {"template_name": "zerver/login.html"},
      name="login_page"),
 path("accounts/login/",
      LoginView.as_view(template_name="zerver/login.html"),
      name="login"),
 path("accounts/logout/", logout_then_login),
 path("accounts/webathena_kerberos_login/", webathena_kerberos_login),
 path("accounts/password/reset/", password_reset, name="password_reset"),
 path(
     "accounts/password/reset/done/",
     PasswordResetDoneView.as_view(
         template_name="zerver/reset_emailed.html"),
 ),
 path(
     "accounts/password/reset/<uidb64>/<token>/",
     PasswordResetConfirmView.as_view(
         success_url="/accounts/password/done/",
         template_name="zerver/reset_confirm.html",
         form_class=LoggingSetPasswordForm,
     ),
     name="password_reset_confirm",
 ),
 path(
     "accounts/password/done/",
     PasswordResetCompleteView.as_view(
         template_name="zerver/reset_done.html"),
 ),
Пример #20
0
# from django.urls import re_path, reverse_lazy
# from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

# urlpatterns = [
#     re_path('^$', PasswordResetView(), {'post_reset_redirect': reverse_lazy('password_reset_done')}, name='password_reset'),
#     re_path(r'^done/$', PasswordResetDoneView(), name='password_reset_done'),
#     re_path(r'^(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', PasswordResetConfirmView(),
#         {'post_reset_redirect': reverse_lazy('password_reset_complete')}, name='password_reset_confirm'),
#     re_path('^complete/$', PasswordResetCompleteView(), name='password_reset_complete')
# ]

from django.urls import path
from django.contrib.auth.views import (
    PasswordResetView, PasswordResetDoneView,
    PasswordResetConfirmView, PasswordResetCompleteView)


urlpatterns = [
    path("reset-password/", PasswordResetView.as_view(), name="password_reset"),
    path("reset-password/done/", PasswordResetDoneView.as_view(), name="password_reset_done"),
    path("reset-password/confirm/<uidb64>/<token>/", PasswordResetConfirmView.as_view(), name="password_reset_confirm"),
    path("reset-password/complete/", PasswordResetCompleteView.as_view(), name="password_reset_complete"),
]
Пример #21
0
        name='login'),
    url(_(r'^logout/$'), view=LogoutView.as_view(next_page='/'), name='logout'),

    url(_(r'^password/'), include([
        url(r'^$', view=PasswordChangeView.as_view(), name='password_change'),
        url(_(r'^done/$'), view=PasswordChangeDoneView.as_view(), name='password_change_done'),
        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'),
Пример #22
0
from django.contrib.auth.views import LogoutView
from django.contrib.auth.views import PasswordResetView
from django.contrib.auth.views import PasswordResetDoneView
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.auth.views import PasswordResetCompleteView
from django.contrib.auth.views import PasswordChangeView
from django.contrib.auth.views import PasswordChangeDoneView
from account.views import index

urlpatterns = [

    path("index",index,name="index"),
    path("signup",SignupView.as_view(),name = 'signup'),
    path('login/', LoginView.as_view(template_name='account/login.html'), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('password_reset/', 
        PasswordResetView.as_view(template_name="account/password_reset_form.html"), name='password_reset'),
    path('password_reset/done/', PasswordResetDoneView.as_view(
        template_name="account/password_reset_done.html"), name='password_reset_done'),
    path('reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(
        template_name="account/password_confirm.html"), name='password_reset_confirm'),
    path('reset/done/', PasswordResetCompleteView.as_view(
        template_name="account/password_reset_complete.html"), name='password_reset_complete'),
    path('password_change/', PasswordChangeView.as_view(
        template_name="account/password_change_form.html"), name='password_change'),
    path('password_change/done/', PasswordChangeDoneView.as_view(
        template_name="account/password_change_done.html"), name='password_change_done'),
    path("create_user",CreateUserView.as_view(),name="create_user"),
    # path('profile/<int:pk>',ProfileView.as_view(),name='profile'),

]
Пример #23
0
from django.conf.urls import url
from verification import views
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, \
    PasswordResetCompleteView

urlpatterns = [
    url('login/', views.login, name="login"),
    url('register/', views.register, name="register"),
    url('update_details/', views.UpdateDetails, name="updatedetails"),
    url('logout/', views.Logout, name="logout"),
    url(r'^password-reset/$',
        PasswordResetView.as_view(
            template_name="verification/password_reset.html"),
        name="password_reset"),
    url(r'^password-reset-done/$',
        PasswordResetDoneView.as_view(
            template_name="verification/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="verification/password_reset_confirm.html"),
        name="password_reset_confirm"),
    url(r'^password-reset-complete/$',
        PasswordResetCompleteView.as_view(
            template_name="verification/password_reset_complete.html"),
        name="password_reset_complete")
]
Пример #24
0
from . import views
from django.contrib.auth.views import (PasswordResetView,
                                       PasswordResetDoneView,
                                       PasswordResetConfirmView,
                                       PasswordResetCompleteView)

urlpatterns = [
    url(r'register/$', views.userRegistration, name='register'),
    url(r'profile/edit/$', views.editProfile, name='editProfile'),
    url(r'login/$', views.loginView, name='logint'),
    url(r'logout/$', auth_views.logout, name='logout'),
    url(r'^password_change/$', views.PasswordChange, name='change'),
    url(r'^password_reset2/$',
        PasswordResetView.as_view(
            template_name='regist/password_reset_form.html'),
        name='reset1'),
    url(r'^password_reset/done/$',
        PasswordResetDoneView.as_view(
            template_name='regist/password_reset_done.html'),
        name='password_reset_done'),
    url(r'^reset/(?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='regist/password_reset_confirm.html'),
        name='password_reset_confirm'),
    url(r'^reset/done/$',
        PasswordResetCompleteView.as_view(
            template_name='regist/password_reset_complete.html'),
        name='password_reset_complete'),
    url(r'^profile/$', views.profileView, name='profilet')
]
Пример #25
0
from django.conf.urls import url,include
from django.contrib import admin
from basic_app import views
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import PasswordResetView,PasswordResetDoneView,PasswordResetConfirmView,PasswordResetCompleteView

urlpatterns = [

    url(r'^$',views.index,name='index'),
    url(r'^admin/', admin.site.urls),
    url(r'^basic_app/',include('basic_app.urls')),
    url(r'^logout/',views.user_logout,name='logout'),
    url(r'^reset_password/$',PasswordResetView.as_view(),name='reset_password'),
    url(r'^reset_password/done/$',PasswordResetDoneView.as_view(),name='password_reset_done'),
    url(r'^reset_password/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',PasswordResetConfirmView.as_view(),name='password_reset_confirm'),
    url(r'^reset_password/complete/$',PasswordResetCompleteView.as_view(),name='password_reset_complete'),
    url(r'^search/$',views.search,name='search'),



]+ static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #26
0
        waffle_switch('login')(LoginView.as_view()),
        name='login'),
    url(r'^password-change$',
        waffle_switch('login')(PasswordChangeView.as_view(
            template_name='registration/passwd_change_form.html',
            success_url='settings')),
        name='password_change'),
    url(r'^forgot-password$',
        waffle_switch('login')(PasswordResetView.as_view(
            template_name='registration/password_forgot_form.html',
            email_template_name='email/email-password-forgot-link.txt',
            html_email_template_name='email/email-password-forgot-link.html',
            from_email=settings.DEFAULT_FROM_EMAIL)),
        name='forgot_password'),
    url(r'^password-reset-done$',
        waffle_switch('login')(PasswordResetDoneView.as_view(
            template_name='registration/password_forgot_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})/$',
        waffle_switch('login')(PasswordResetConfirmView.as_view(
            template_name='registration/password_forgot_reset_confirm_form.html'
        )),
        name='password_reset_confirm'),
    url(r'^password-reset-complete$',
        waffle_switch('login')(PasswordResetCompleteView.as_view(
            template_name='registration/password_forgot_reset_complete.html')),
        name='password_reset_complete'),
    url(r'^activation-verify/(?P<activation_key>[^/]+)/$',
        waffle_switch('login')(activation_verify),
        name='activation_verify'),
]
Пример #27
0
 url(r'^password_reset/$',
     PasswordResetView.as_view(
         template_name='landing/password_reset.html',
         email_template_name='landing/password_reset_email.html',
         from_email='*****@*****.**'),
     name='password_reset'),
 url(r'^password_reset_confirm/(?P<uidb64>[-\w]+)/(?P<token>[-\w]+)/$',
     PasswordResetConfirmView.as_view(
         template_name='landing/password_reset_confirm.html'),
     name='password_reset_confirm'),
 url(r'^password_reset_complete/$',
     PasswordResetCompleteView.as_view(
         template_name='landing/password_reset_complete.html'),
     name='password_reset_complete'),
 url(r'^password_reset_done/$',
     PasswordResetDoneView.as_view(
         template_name='landing/password_reset_done.html'),
     name='password_reset_done'),
 url(r'^search_ajax/$', views.search_ajax),
 url(r'^search_ajax_service/$', views.search_ajax_service),
 url(r'^search_ajax_city/$', views.search_ajax_city),
 url(r'^search_ajax_street/$', views.search_ajax_street),
 url(r'^uslugi-kosmetologicheskie/$', views.salon, name='salon'),
 url(r'^uslugi-kosmetologicheskie/(?P<q_1>[\w-]+)/(?P<q_2>[\w-]+)/(?P<q_3>[\w-]+)/(?P<q_4>[\w-]+)/(?P<q_5>[\w-]+)/(?P<q_6>[\w-]+)/$',
     views.search_service_address,
     name='search_service_address'),
 url(r'^contact/$', views.contact, name='contact'),
 url(r'^about/$', views.about, name='about'),
 url(r'^warsztaty/$', views.training, name='training'),
 url(r'^warsztaty/(?P<slug>[\w-]+)/$',
     views.training_item,
     name='training_item'),
Пример #28
0
 path('multiGame/dismiss_invitation',dismiss_invitation, name='dismiss_invitation'),
 path('multiGame/join_room',join_room, name='join_room'),
 # Home
 path('wallet',wallet, name='wallet'),
 path('warehouse',warehouse, name='warehouse'),
 path('friend',friend, name='friend'),
 path('search_friend/<name>', search_friend,name='search_friend'),
 path('invite_friend',invite_friend, name='invite_friend'),
 path('approve_friend',approve_friend, name='approve_friend'),
 path('dismiss_friend',dismiss_friend, name='dismiss_friend'),
 path('get_friend',get_friend, name='get_friend'),
 path('get_friendwaitlist',get_friendwaitlist, name='get_friendwaitlist'),
 url(r'^media/(?P<path>.*)', serve, {"document_root":MEDIA_ROOT}),
 path('confirmEmail/<str:username>/<slug:token>/',confirmEmail, name='confirm'),
 url(r'^resetPassword/$',PasswordResetView.as_view(template_name='authen/password_reset.html'),name='reset_password'),
 url(r'^resetPassword/done/$',PasswordResetDoneView.as_view(template_name='authen/password_reset_done.html'), name='password_reset_done'),
 url(r'^resetPassword/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
     PasswordResetConfirmView.as_view(template_name='authen/password_reset_confirm.html'), name='password_reset_confirm'),
 url(r'^resetPassword/complete/$',
     PasswordResetCompleteView.as_view(template_name='authen/password_reset_complete.html'), name='password_reset_complete'),
 path('add_item', add_item, name='add_item'),
 path('order_item', order_item, name='order_item'),
 path('feed',feed, name='feed'),
 path('feedFriend',feed_friend,name='feedFriend'),
 path('singleGame/instruction', singleIns, name='singleIns'),
 path('multiGame/instruction',multiIns, name='multiIns'),
 path('multiGame/check_status',check_status, name='check_status'),
 path('multiGame/guest_gameRoom/get_online_friends',get_online_friends, name='get_online_friends'),
 path('multiGame/guest_gameRoom/invite_friend_play',invite_friend_play, name='invite_friend_play'),
 path('gameroom/', gameRoom, name='gameRoom'),
 path('multiGame/guest_gameRoom/', guest_gameRoom, name='guest_gameRoom'),
Пример #29
0
 path("reset/",
      PasswordResetView.as_view(
          template_name="users/login.html",
          email_template_name="users/password_reset_email.html",
          success_url='/accounts/reset/requested/',
          extra_context={
              "form": CustomAuthenticationForm,
              "createform": CreateForm,
              "title": _("Password reset"),
          },
      ),
      name="password_reset"),
 path("reset/requested/",
      PasswordResetDoneView.as_view(
          template_name="users/password_reset_requested.html",
          extra_context={
              "title": _("Password reset requested"),
          }),
      name="password_reset_done"),
 path("reset/confirm/<str:uidb64>/<str:token>/",
      PasswordResetConfirmView.as_view(
          template_name="users/password_change.html",
          form_class=CustomSetPasswordForm,
          success_url='/accounts/reset/complete/',
          post_reset_login=True,
          extra_context={
              "title": _("Set new password"),
          },
      ),
      name="password_reset_confirm"),
 path("reset/complete/",
Пример #30
0
    path('admin/', admin.site.urls),
    path('', include('login.urls')),
    path('userlogin/', include('userlogin.urls')),
    path('login/',
         auth_views.LoginView.as_view(template_name='userlogin/index.html'),
         name='login'),
    path('logout/',
         auth_views.LogoutView.as_view(template_name='login/home.html'),
         name='logout'),
    path('reset-password/',
         PasswordResetView.as_view(
             template_name='userlogin/password_reset_form.html',
             email_template_name="userlogin/reset_password_email.html",
             success_url="done/"),
         name="password_reset"),
    path('reset-password/done/',
         PasswordResetDoneView.as_view(
             template_name='userlogin/password_reset_done.html'),
         name="password_reset_done"),
    path('reset-password/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/',
         PasswordResetConfirmView.as_view(
             template_name="userlogin/password_reset_confirm.html"),
         name="password_reset_confirm"),
    path(r'reset-password/complete/',
         PasswordResetCompleteView.as_view(
             template_name="userlogin/password_reset_complete.html"),
         name="password_reset_complete"),
    path('foodtruck/', include('foodtruck.urls')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Пример #31
0
    0,
    url(r'^tethys_apps/tethysapp/(?P<app_id>[0-9]+)/clear-workspace/$',
        tethys_portal_admin.clear_workspace,
        name='clear_workspace'))

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/$',
        never_cache(
            PasswordResetView.as_view(
                success_url=reverse_lazy('accounts:password_reset_done'))),
        name='password_reset'),
    url(r'^password/reset/done/$',
        never_cache(PasswordResetDoneView.as_view()),
        name='password_reset_done'),
    url(r'^password/reset/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
        never_cache(
            PasswordResetConfirmView.as_view(
                success_url=reverse_lazy('accounts:password_done'))),
        name='password_confirm'),
    url(r'^password/done/$',
        never_cache(PasswordResetCompleteView.as_view()),
        name='password_done'),
]

user_urls = [
    url(r'^$', tethys_portal_user.profile, name='profile'),
    url(r'^settings/$', tethys_portal_user.settings, name='settings'),
    url(r'^change-password/$',
Пример #32
0
 def test_PasswordResetDoneView(self):
     response = PasswordResetDoneView.as_view()(self.request)
     self.assertContains(response, '<title>Password reset sent</title>')
     self.assertContains(response, '<h1>Password reset sent</h1>')
Пример #33
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 django.contrib.staticfiles.views import serve
from django.views.decorators.cache import never_cache
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    path('captcha/', include('captcha.urls')),
    path('admin/', admin.site.urls),
    path('', include('main.urls', namespace='')),
    path('social/', include('social_django.urls', namespace='social')),
    path('accounts/password_reset/done/',
         PasswordResetDoneView.as_view(template_name='main/email_sent.html'),
         name='password_reset_done'),
    path('accounts/reset/<uidb64>/<token>',
         PasswordResetConfirmView.as_view(
             template_name='main/confirm_password.html'),
         name='password_reset_confirm'),
    path('accounts/password_reset/complete/',
         PasswordResetCompleteView.as_view(
             template_name='main/password_confirmed.html'),
         name='password_reset_complete'),
    # path('', include('django.contrib.auth.urls')),
]

if settings.DEBUG:
    urlpatterns.append(path('static/<path:path>', never_cache(serve)))
    urlpatterns += static(settings.MEDIA_URL,
Пример #34
0
    path('listmembers/', views.list_members, name='members'),
    #url for gender ajax feature
    path('gender/', views.getgender, name='gender'),
    #url for age range ajax feature
    path('agerange/', views.age_range, name='agerange'),
    #url for age and gender ajax feature
    path('ageandg/', views.ageAndGender, name='ageandg'),
    #url for search by first name ajax feature
    path('search/', views.searchuser, name='search'),
    #url for google maps location feature and doodle
    path('locate/', views.locate, name='locate'),
    #url for the ajax call to upload image
    path('uploadimage/', views.upload_image, name='uploadimage'),

    #PASSWORD RESET URLS
    path('password_reset/',
         PasswordResetView.as_view(
             template_name='registration/password_reset_form.html',
             success_url='done/'),
         name="password_reset"),
    path('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"),
]
Пример #35
0
        name="share"),
    path('share/', views.share, name='share'),
    path('loadIcons/', views.loadIcons, name='loadIcons'),
    path('search/', views.search, name='search'),
    #url(r'^(?P<slug>[\w-]+)/$',  views.share, name='share'),
    #path('<slug:slug>', views.share, name='share'),
    # API
    #PASSWORD RESET URLS
    path('password_reset/',
         PasswordResetView.as_view(
             template_name='fastcookapp/registration/password_reset_form.html',
             success_url='done/'),
         name="password_reset"),
    path(
        'password_reset/done/',
        PasswordResetDoneView.as_view(
            template_name='fastcookapp/registration/password_reset_done.html'),
        name="password_reset_done"),
    path(
        'reset/<uidb64>/<token>/',
        PasswordResetConfirmView.as_view(
            template_name='fastcookapp/registration/password_reset_confirm.html'
        ),
        name="password_reset_confirm"),
    path('reset/done/',
         PasswordResetCompleteView.as_view(
             template_name=
             'fastcookapp/registration/password_reset_complete.html'),
         name="password_reset_complete")

    #url('^', include('django.contrib.auth.urls'))
]
Пример #36
0
    url(r'^profile/change-password/$',
        PasswordChangeView.as_view(
            template_name="accounts/change_password.html",
            form_class=PasswordChange,
            success_url=reverse_lazy('accounts:view_profile')),
        name='change_password'),
    #url(r'^profile/change-password/$', views.change_password, name='change_password'),
    url(r'^reset-password/$',
        PasswordResetView.as_view(
            template_name='accounts/reset_password.html',
            success_url=reverse_lazy('accounts:password_reset_done'),
            form_class=CustomPasswordResetForm,
            email_template_name='accounts/reset_password_email.html'),
        name='reset_password'),
    url(r'^reset-password/done/$',
        PasswordResetDoneView.as_view(
            template_name='accounts/reset_password_done.html'),
        name='password_reset_done'),
    #<uidb64>/<token>/
    #
    url(r'^reset-password/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
        PasswordResetConfirmView.as_view(
            template_name='accounts/reset_password_confirm.html',
            success_url=reverse_lazy('accounts:password_reset_complete')),
        name='password_reset_confirm'),
    url(r'^reset-password/complete/$',
        PasswordResetCompleteView.as_view(
            template_name='accounts/reset_password_complete.html'),
        name='password_reset_complete'),
]
Пример #37
0
         template_name="perfil_login.html",
         redirect_field_name="next",
     ),
     name="login",
 ),
 path("cuenta/salir/",
      LogoutView.as_view(next_page="cuenta:login"),
      name="logout"),
 path("cuenta/perfil/", login_required(perfil), name="perfil"),
 path("", login_required(perfil), name="perfil2"),
 path("cuenta/cambiar-clave/",
      login_required(cambio_clave),
      name="cambiar-clave"),
 path(
     "cuenta/reiniciar-clave-enviado/",
     PasswordResetDoneView.as_view(template_name="reinicio_enviado.html"),
     name="reiniciar-enviado",
 ),
 path(
     "cuenta/reiniciar-clave/",
     PasswordResetView.as_view(
         template_name="reinicio_clave.html",
         email_template_name="reinicio_correo.html",
         success_url=reverse_lazy("cuenta:reiniciar-enviado"),
     ),
     name="reiniciar-clave",
 ),
 path(
     "cuenta/nueva-clave/<uidb64>/<token>/",
     PasswordResetConfirmView.as_view(
         template_name="reinicio_nueva_clave.html",
Пример #38
0
from django.urls import path
from django.contrib.auth.views import LoginView, PasswordResetView, PasswordResetDoneView,\
    PasswordResetConfirmView, PasswordResetCompleteView
from .views import LogoutView, RegisterView, ProfileView, ImageUpdateView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('register/', RegisterView.as_view(), name='register'),
    path('password_reset/', PasswordResetView.as_view(), name='password_reset'),
    path('password_reset/done/', PasswordResetDoneView.as_view(),
         name='password_reset_done'),
    path('password_reset/confirm/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(), name='password_reset_confirm'),
    path('password_reset/complete/', PasswordResetCompleteView.as_view(),
         name='password_reset_complete'),
    path('profile/<int:pk>/', ProfileView.as_view(), name='profile'),
    path('profile/picture/', ImageUpdateView.as_view(), name='update_image'),
]
Пример #39
0
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. 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.contrib import admin
from django.urls import path,include
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LoginView,LogoutView,PasswordChangeView,PasswordResetView,PasswordResetDoneView,PasswordResetConfirmView,PasswordResetCompleteView
#from django.contrib.auth import views as auth_views


urlpatterns = static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
urlpatterns += [
    path('admin/', admin.site.urls),
    path('', include('property.urls', namespace='property')),
    path('', include('users.urls', namespace='users')),
    path('login/', LoginView.as_view(template_name='registration/login.html'), name="login"),
    path('logout/', LogoutView.as_view(template_name= 'registration/login.html'), name="logout"),
    path('change-password/',PasswordChangeView.as_view(template_name='registration/change-password.html',success_url = '/change-password/'),name='change_password'),

    path('password_reset/',PasswordResetView.as_view(template_name='registration/password_rest.html'), name='password_reset'),
    path('password_reset/done/',PasswordResetDoneView.as_view(template_name='registration/password_reset_message.html'), name='password_reset_done'),
    path('reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(template_name='registration/password_reset_confirm.html'), name='password_reset_confirm'),
    path('reset/done/',PasswordResetCompleteView.as_view(template_name='registration/password_reset_done.html'), name='password_reset_complete'),
]
Пример #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
 path(
     "reset/",
     PasswordResetView.as_view(
         template_name="accounts/password_reset.html",
         html_email_template_name="accounts/password_reset_email.html",
         email_template_name="accounts/password_reset_email.html",
         subject_template_name="accounts/password_reset_subject.txt",
         success_url=reverse_lazy("accounts:password_reset_done"),
         from_email=f"Info IDN.ID <{settings.EMAIL_FORM}>",
     ),
     name="password_reset",
 ),
 path(
     "reset/done/",
     PasswordResetDoneView.as_view(
         template_name="accounts/password_reset_done.html"
     ),
     name="password_reset_done",
 ),
 path(
     "reset/<str:uidb64>/<str:token>/",
     PasswordResetConfirmView.as_view(
         template_name="accounts/password_reset_confirm.html",
         success_url=reverse_lazy("accounts:password_reset_complete"),
     ),
     name="password_reset_confirm",
 ),
 path(
     "reset/complete/",
     PasswordResetCompleteView.as_view(
         template_name="accounts/password_reset_complete.html"
Пример #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/?$',