Ejemplo n.º 1
1
def password_reset(request):
    """Display a password reset form"""
    if settings.USE_ALL_AUTH:
        # noinspection PyPackageRequirements
        from allauth.account.views import password_reset

        return password_reset(request)
    return PasswordResetView.as_view()(request)
Ejemplo n.º 2
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'
        )
    ]
Ejemplo n.º 3
0
def password_reset(request, extra_context=None):
    """
    Display the password reset form.
    """
    form_class = import_string(getattr(settings, 'SHIPANARO_AUTH_PASSWORD_RESET_FORM', 'django.contrib.auth.forms.PasswordResetForm'))
    defaults = view_defaults(extra_context, form_class=form_class)
    return PasswordResetView.as_view(**defaults)(request)
Ejemplo n.º 4
0
def password_reset(request):
    from_registration = request.GET.get('registration', False)
    extra_context = {
        'from_registration': from_registration,
    }
    auth_password_reset = PasswordResetView.as_view(
                            form_class = PasswordResetForm,
                            template_name='accounts/password_reset_form.html',
                            email_template_name='registration/password_reset_email_user_list.html')
    return auth_password_reset(request, extra_context=extra_context)
Ejemplo n.º 5
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>')
Ejemplo n.º 6
0
urlpatterns = [
    # path('', LoginView.as_view(template_name='accounts/login.html'),name='home'),
    path('', RedirectView.as_view(permanent = False, url='/dashboard'), name='home'),    
    path('accounts/login/', LoginView.as_view(template_name='accounts/login.html'),name='accounts_login'),
    # 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    
from django.conf.urls import url
from django.urls import path
from django.urls import reverse_lazy
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    path('', PasswordResetView.as_view(), {'post_reset_redirect': reverse_lazy('password_reset_done')}, name='password_reset'),
    path('done/', PasswordResetDoneView.as_view(), name='password_reset_done'),
    url(r'^(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$', PasswordResetConfirmView.as_view(),
        {'post_reset_redirect': reverse_lazy('password_reset_complete')}, name='password_reset_confirm'),
    path('complete/', PasswordResetCompleteView.as_view(), name='password_reset_complete')
]
Ejemplo n.º 8
0
 path('login/', views.user_login, name='user_login'),
 path('logout/', views.user_logout, name='user_logout'),
 path('register/', views.register, name='user_register'),
 # url('login/',auth_views.LoginView,name='user_login'),  内置登陆 参数问题 未搞懂 先放一放
 # # url('new-login/',auth_views.LoginView,{"template_name":"account/login.html"}), 内置登陆 参数问题 未搞懂 先放一放
 path('password-change/',
      PasswordChangeView.as_view(
          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"),
Ejemplo n.º 9
0
        TemplateView.as_view(template_name='about.html'), name='about'),
    path('contact/',
        TemplateView.as_view(template_name='contact.html'), name='contact'),

    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'),
Ejemplo n.º 10
0
 url(r'^Nueva/$', views.MascotaCreate.as_view(), name="MascotaNueva"),
 url(r'^MostrarMascota/$',
     views.MascotaList.as_view(),
     name="MostrarMascota"),
 url(r'^MascotaUpdate/(?P<pk>\d+)/$',
     views.MascotaUpdate.as_view(),
     name="editarMascota"),
 url(r'^MascotaDelete/(?P<pk>\d+)/$',
     views.MascotaDelete.as_view(),
     name="MascotaDelete"),
 url(r'^Formulario/$', views.formulario, name="formulario"),
 url(r'^QuienesSomos/$', views.quienessomos, name="quienessomos"),
 url(r'^VerMascota/$', views.VerMascota, name="VerMascota"),
 #introducimos urls para poder recuperar la contraseña por email cosa no muy facil
 url(r'^password_reset',
     PasswordResetView.as_view(), {
         'template_name': 'password_reset_form.html',
         'email_template_name': 'password_reset_email.html'
     },
     name='password_reset'),
 url(r'^password_reset_done',
     PasswordResetDoneView.as_view(),
     {'template_name': 'password_reset_done.html'},
     name='password_reset_done'),
 url(r'^reset/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>.+)/$',
     PasswordResetConfirmView.as_view(),
     {'template_name': 'password_reset_confirm.html'},
     name='password_reset_confirm'),
 url(r'^reset/done',
     PasswordResetCompleteView.as_view(),
     {'template_name': 'password_reset_complete.html'},
Ejemplo n.º 11
0
def password_reset(request: HttpRequest) -> HttpResponse:
    view_func = DjangoPasswordResetView.as_view(
        template_name='zerver/reset.html',
        form_class=ZulipPasswordResetForm,
        success_url='/accounts/password/reset/done/')
    return view_func(request)
Ejemplo n.º 12
0
        name='repmuni_photo'),
    url(r'^mapa/$', views.Mapa, name='mapa'),
    url(r'^register/$', views.register, name='register'),
    url(r'^profile/$', views.view_profile, name='profile'),
    url(r'^profile/edit$', views.edit_profile, name='profile_edit'),
    url('^', include('django.contrib.auth.urls')),
    url(r'^login/$',
        LoginView.as_view(authentication_form=AuthenticationForm_CDGRD),
        name='login'),
    url(r'^logout/$', LogoutView.as_view(), name='logout'),
    url(r'^password-change/$',
        PasswordChangeView.as_view(success_url='done/'),
        name='password_change'),
    url(r'^password-change/done/$',
        PasswordChangeDoneView.as_view(),
        name='password_change_done'),
    url(r'^reset-password/$',
        PasswordResetView.as_view(success_url='done/'),
        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>[0-9A-Za-z]{1,3}-[0-9A-Za-z]{1,20})/$',
        PasswordResetConfirmView.as_view(
            success_url='/repmuni/reset-password/complete/'),
        name='password_reset_confirm'),
    url(r'^reset-password/complete/$',
        PasswordResetCompleteView.as_view(),
        name='password_reset_complete'),
]
Ejemplo n.º 13
0
 path('account/logout/',
      LogoutView.as_view(template_name='blog/logout.html'),
      name="logout"),
 path('register/mentor', views.MentorRegister, name='mentor_register'),
 path('register/mentee', views.MenteeRegister, name='mentee_register'),
 path('register/', views.RegisterLanding, name='register'),
 path('profile/', views.view_profile, name='view_profile'),
 path('account/profile/', views.view_profile, name='view_profile'),
 path('account/profile/<int:pk>/',
      views.view_profile,
      name='view_profile_pk'),
 path('account/profile/edit/', views.edit_profile, name='edit_profile'),
 path('change-password/', views.change_password, name='change_password'),
 path('reset-password/',
      PasswordResetView.as_view(
          template_name='blog/reset_password.html',
          success_url=reverse_lazy('blog:password_reset_done'),
          email_template_name='blog/reset_password_email.html'),
      name='reset_password'),
 path('reset-password/done/',
      PasswordResetDoneView.as_view(
          template_name='blog/password_reset_done.html'),
      name='password_reset_done'),
 path('reset-password/confirm/<uidb64>/<token>/',
      PasswordResetConfirmView.as_view(
          template_name='blog/password_reset_confirm.html',
          success_url=reverse_lazy('blog:password_reset_complete')),
      name='password_reset_confirm'),
 path('reset-password/complete/',
      PasswordResetCompleteView.as_view(
          template_name='blog/password_reset_complete.html'),
      name='password_reset_complete'),
Ejemplo n.º 14
0
    url(_(r'^login/$'),
        view=LoginView.as_view(
            redirect_authenticated_user=True,
            redirect_field_name=settings.REDIRECT_FIELD_NAME,
        ),
        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>.+?)/$'),
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, \
    PasswordResetCompleteView
from django.urls import path
from .views import LoginView, LogoutView, ProfileView, PasswordChangeView, PasswordChangeDoneView, RegisterView

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('profile/', ProfileView.as_view(), name='profile'),
    path('password_change/',
         PasswordChangeView.as_view(),
         name='password_change'),
    path('password_change/done',
         PasswordChangeDoneView.as_view(),
         name='password_change_done'),
    path('register/', RegisterView.as_view(), name='register'),
    path('password_reset/', PasswordResetView.as_view(),
         name='password_reset'),
    path('password_reset_sent/',
         PasswordResetDoneView.as_view(),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('password_reset_complete/',
         PasswordResetCompleteView.as_view(),
         name='password_reset_complete'),
]
Ejemplo n.º 16
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, include
from django.contrib.auth.views import PasswordResetView, PasswordResetConfirmView, PasswordResetDoneView, PasswordResetCompleteView
from django.conf.urls.i18n import i18n_patterns
from User_Registration.views import user_registration_view, showIndex
from User_Registration import views
urlpatterns = [
    path('admin/doc/', include('django.contrib.admindocs.urls')),
    path('admin/', admin.site.urls),
    path('', include('User_Registration.urls')),
    path('', include('DashBoard.urls')),
    path('resetpassword', PasswordResetView.as_view(), name='password_reset'),
    path('resetpassword/done',
         PasswordResetDoneView.as_view(),
         name='password_reset_done'),
    path('resetpassword/confirm/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('resetpassword/complete',
         PasswordResetCompleteView.as_view(),
         name='password_reset_complete'),
    path('', views.showIndex, name='index')
]
Ejemplo n.º 17
0
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
from django.urls import path, include, reverse_lazy

urlpatterns = [
    path('', PasswordResetView.as_view(), name="password_reset"),
    path('done/', PasswordResetDoneView.as_view(), name="password_reset_done"),
    path(
        '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('complete/',
         PasswordResetCompleteView.as_view(),
         name="password_reset_complete"),
]
Ejemplo n.º 18
0
from django.contrib import admin
from django.urls import path, include, re_path
from django.views.generic import TemplateView
#from django.contrib.auth.views import login, logout
from django.contrib.auth.views import LoginView, PasswordResetView

from . import views

app_name = 'main'
urlpatterns = [
    #path('test/', views.test, name="test"),
    path('accounts/', include('django.contrib.auth.urls')),
    path('registration/', views.registration, name="registration"),
    path('add_user/', views.RegisterFormView.as_view(), name="add_user"),
    path('test/', TemplateView.as_view(template_name="test.html")),
    path('internat/', views.internat, name="internat"),
    path('kindergarten/', views.kindergarten, name="kindergarten"),
    path('rehabilitation/', views.rehabilitation, name="rehabilitation"),
    path('sponsor/', views.sponsor, name="sponsor"),
    path('vacancies/', views.vacancies, name="vacancies"),
    path('login/', LoginView.as_view(template_name='login.html'),
         name="login"),
    path('password_reset/',
         PasswordResetView.as_view(template_name='password_change_form.html'),
         name='password_reset'),
    path('index/', views.index, name="index"),
    path('my/', views.users_page, name="users_page")
]
Ejemplo n.º 19
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'),
]
Ejemplo n.º 20
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')),
]
Ejemplo n.º 21
0
    path('registration/verify-email/',
         VerifyEmailView.as_view(),
         name='verify-email'),

    # Url ktoré neboli zatiaľ prepísané do restu.
    path('register/', register, name='register-to-be-deleted'),
    path('verify/<str:uidb64>/<str:token>/', verify, name='verify'),
    path('profile/update/', profile_update, name='profile-update'),
    path('profile/<int:pk>/', UserProfileView.as_view(),
         name='profile-detail'),

    # Obnovenie hesla
    path('password-reset/',
         PasswordResetView.as_view(
             template_name='user/password_reset.html',
             success_url=reverse_lazy('user:password-reset-done'),
             email_template_name='user/emails/password_reset.txt',
             html_email_template_name='user/emails/password_reset.html'),
         name='password-reset'),
    path('password-reset-confirm/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='user/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='user/password_reset_done.html'),
         name='password-reset-done'),

    # Zmena hesla
    path('password-reset-complete/',
Ejemplo n.º 22
0
Archivo: urls.py Proyecto: ekt68/texta
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'),
    ]   
Ejemplo n.º 23
0
         views.notification_delete,
         name="ajax/notification/delete"),
]

urlpatterns = [
    path('', views.LoginView.as_view(), name='index'),
    path('login/', views.LoginView.as_view(), name='login'),
    path('login_success/', views.loginSuccess, name='login_success'),
    path('details/', views.AccountsDetailsView.as_view(), name='details'),

    #  Password update and reset
    path('password_change/',
         views.PasswordChange.as_view(),
         name='password_change'),
    path('password_reset/',
         PasswordResetView.as_view(form_class=UserPasswordResetForm),
         name="password_reset"),
    path('preferences/', views.preferences, name='preferences'),

    #  Account registration and activation
    path('register/', views.AccountsRegisterView.as_view(), name='register'),
    re_path(
        r'^activate/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,20})/$',
        views.activate,
        name='activate'),
    re_path(r'send_activation_mail/(?P<uidb64_username>[0-9A-Za-z_\-]+)/$',
            views.resend_activation_mail,
            name='resend_email_confirmation'),

    #  Ajax views
    path('ajax/', include(ajax_api_urlpatterns))
Ejemplo n.º 24
0
from django.contrib.admin.views.decorators import staff_member_required
admin.site.login = staff_member_required(admin.site.login, redirect_field_name="", login_url='/accounts/login/')

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'),
]
Ejemplo n.º 25
0
from django.urls import path, reverse_lazy
from .views import *
from django.contrib.auth.views import PasswordChangeView, PasswordChangeDoneView, PasswordResetConfirmView,\
    PasswordResetDoneView, PasswordResetView

app_name = 'account'

urlpatterns = [
    path('', dasboard, name='dashboard'),
    path('login/', user_login, name='login'),
    path('logout/', user_logout, name='logout'),
    path('password_reset/',
         PasswordResetView.as_view(
             template_name='registration/password_reset_form.html',
             email_template_name='registration/password_reset_email.html',
             subject_template_name='registration/password_reset_subject.txt',
             title='Password reset for your account "t_social_network"',
             success_url=reverse_lazy('account:password_reset_done')),
         name='password_reset'),
    path('password_reset/done/',
         PasswordResetDoneView.as_view(
             template_name='registration/password_reset_done.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(),
         name='password_reset_confirm'),
    path('password_change/',
         PasswordChangeView.as_view(),
         name='password_change'),
    path('password_change/done/',
         PasswordChangeDoneView.as_view(
Ejemplo n.º 26
0
     name='login'),
 url(r'^logout/$',
     LogoutView.as_view(template_name='logout.html'),
     name='logout'),
 url(r'^password_change/$',
     PasswordChangeView.as_view(
        template_name='password_change_form.html'),
     name='password_change'),
 url(r'^password_change/done/$',
     PasswordChangeDoneView.as_view(
        template_name='password_change_done.html'),
     name='password_change_done'),
 url(r'^password_reset/$',
     PasswordResetView.as_view(
         template_name='password_reset_form.html',
         email_template_name='password_reset_email.html',
         subject_template_name='password_reset_subject.txt',
         from_email=settings.VENUE['mailout_delivery_report_to'],
         extra_email_context=settings.VENUE),  # TODO make this work
     name='password_reset'),
 url(r'^password_reset/done/$',
     PasswordResetDoneView.as_view(
         template_name='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='password_reset_confirm.html'),
     name='password_reset_confirm'),
 url(r'^reset/done/$',
     PasswordResetCompleteView.as_view(
         template_name='password_reset_complete.html'),
     name='password_reset_complete'),
Ejemplo n.º 27
0
urlpatterns = [
    path('login', LoginView.as_view(template_name="auth.login.html"),
         name='auth_login'),
    path('logout', LogoutView.as_view(next_page='/'), name='auth_logout'),
    path('', login_required(TemplateView.as_view(template_name="auth.main.html")),
         name='auth_main'),

    # Views to change password as logged-in
    path('password_change/', PasswordChangeView.as_view(), name='auth_password_change'),
    path('password_change/done/', PasswordChangeDoneView.as_view(), name='auth_password_change_done'),

    # Views to reset a password.
    path('password_reset/',
         PasswordResetView.as_view(
             email_template_name='auth.password_reset_email.html',
             template_name='auth.password_reset_form.html',
             success_url=reverse_lazy('auth_password_reset_done')
         ),
         name='auth_password_reset'),
    path('password_reset/done/',
         PasswordResetDoneView.as_view(template_name='auth.password_reset_done.html'),
         name='auth_password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='auth.password_reset_confirm.html',
             success_url=reverse_lazy('auth_password_reset_complete')
         ),
         name='auth_password_reset_confirm'),
    path('reset/done/',
         PasswordResetCompleteView.as_view(template_name='auth.password_reset_complete.html'),
         name='auth_password_reset_complete'),
Ejemplo n.º 28
0
from django.urls import include, path
from django.contrib.auth.views import LogoutView, PasswordResetView

from users.forms import EmailPasswordResetForm
from users.views import create_user_account


urlpatterns = [
    path('logout/', LogoutView.as_view(next_page='landing_page'), name='logout'),
    path('password_reset/', PasswordResetView.as_view(form_class=EmailPasswordResetForm), name='password_reset'),
    path('', include('django.contrib.auth.urls')),
    path('signup/', create_user_account, name='create_user_account')
]

Ejemplo n.º 29
0
from django.contrib.auth.views import LoginView , LogoutView , PasswordResetView , PasswordResetDoneView , \
    PasswordResetConfirmView , PasswordResetCompleteView , PasswordChangeView , PasswordChangeDoneView
from django.urls import path, include, re_path

urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('mt.urls')),
    re_path(r'^accounts/login/$',
            LoginView.as_view(template_name='registration/login.html'),
            name="login"),
    re_path(r'^accounts/login/$',
            LogoutView.as_view(template_name='registration/login.html'),
            LogoutView.next_page,
            name="logout"),
    re_path(r'^accounts/password/reset/$',
            PasswordResetView.as_view(
                template_name='registration/password_reset_page.html'),
            name='password_reset'),
    re_path(r'^accounts/password/reset/done/$',
            PasswordResetDoneView.as_view(
                template_name='registration/passwordreset_pagedone.html'),
            name='password_reset_done'),
    re_path(
        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(
            template_name='registration/password_reset_confirmpage.html'),
        name='password_reset_confirm'),
    re_path(r'^accounts/password/reset/complete/$',
            PasswordResetCompleteView.as_view(
                template_name='registration/password_reset_completepage.html'),
            name='password_reset_complete'),
    re_path(r'^accounts/password/change/$',
Ejemplo n.º 30
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/', views.register, name='register'),
 path('profile/', views.view_profile, name='view_profile'),
 path('profile/(?P<pk>\d+)/',
      views.view_profile,
      name='view_profile_with_pk'),
 path('profile/edit/', views.edit_profile, name='edit_profile'),
 path('change-password/', views.change_password, name='change_password'),
 path('password-reset/',
      PasswordResetView.as_view(
          template_name='accounts/password_reset.html',
          success_url=reverse_lazy('accounts:password_reset_done')),
      {'email_template_name': 'accounts/password_reset_email.html'},
      name='password_reset'),
 path('password-reset/done/',
      PasswordResetDoneView.as_view(
          template_name='accounts/password_reset_done.html'),
      name='password_reset_done'),
 path('password-reset/confirm/<uidb64>/<token>/',
      PasswordResetConfirmView.as_view(
          template_name='accounts/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_complete.html'),
Ejemplo n.º 31
0
app_name = 'accounts'

urlpatterns = [
    url(r'^$', ProfileList.as_view(), name='list'),
    url(r'^new/$', ProfileCreate.as_view(), name='new'),
    url(r'^update/(?P<pk>\d+)/$', ProfileUpdate.as_view(), name='update'),
    url(r'^delete/(?P<pk>\d+)/$', ProfileDelete.as_view(), name='delete'),
    url(r'^change-password/$',
        PasswordChangeView.as_view(
            success_url=reverse_lazy('contas:perfil'),
            template_name='account/registration/password_change.html'),
        name='password_change'),
    url(r'^password_reset/$',
        PasswordResetView.as_view(
            email_template_name='registration/password_reset_email.html',
            template_name='account/registration/password_reset.html',
        ),
        name='password_reset'),
    url(r'^password_reset/done/$',
        PasswordResetDoneView.as_view(
            template_name='registration/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(),
        name='password_reset_confirm'),
    url(r'^reset/done/$',
        PasswordResetCompleteView.as_view(),
        name='password_reset_complete'),
    url(r'^login/$',
        LoginView.as_view(template_name='account/registration/login.html'),
        name='login'),
Ejemplo n.º 32
0
from django.contrib.auth.views import PasswordResetCompleteView
from django.contrib.auth.views import PasswordResetConfirmView
from django.contrib.auth.views import PasswordResetDoneView
from django.contrib.auth.views import PasswordResetView
from django.urls import path
from . import views

urlpatterns = [
    path('create-account/', views.CreateAccount, name='CreateAccount'),
    path('login/', views.Login, name='Login'),
    path('logout/', views.signout, name="signout"),
    path('profile/', views.profile, name="profile"),
    path('change_password/', views.change_password, name="change_password"),
    path('activate/<uidb64>/<token>/', views.activate, name='activate'),
    path('reset-password/', PasswordResetView.as_view(),
         name="reset_password"),
    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"),
]
Ejemplo n.º 33
0
)

app_name = 'Registration_App'

urlpatterns = [

    # users login, logout and create account
    path('login/', UsersProfile_LoginView.as_view(), name='Login-Page'),
    path('logout/', UsersProfile_LogoutView.as_view(), name='Logout-Page'),
    path('register/', UsersProfile_CreateView.as_view(), name='Register-Page'),

    # 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'),
    PasswordResetConfirmView,
    PasswordResetCompleteView,
)

urlpatterns = [
    path('', views.index, name='home'),
    path('about/',
         TemplateView.as_view(template_name='about.html'),
         name='about'),
    path('contact/',
         TemplateView.as_view(template_name='contact.html'),
         name='contact'),
    path('books/<slug>/', views.book_detail, name='book_detail'),
    path('books/<slug>/edit', views.edit_book, name='edit_book'),
    path('accounts/password/reset/',
         PasswordResetView.as_view(
             template_name='registration/password_reset_form.html'),
         name="password_reset"),
    path('accounts/password/reset/done/',
         PasswordResetView.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/',
         PasswordResetCompleteView.as_view(
             template_name='registration/password_reset_complete.html'),
         name="password_reset_complete"),
    path('accounts/', include('registration.backends.simple.urls')),
    path('admin/', admin.site.urls),
Ejemplo n.º 35
0
    url(r'update_model$', views.update_model, name='update_model'),
    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'),
]
Ejemplo n.º 36
0
    Serve static files using the django static files configuration
    WITHOUT collectstatic. This is slower, but very useful for API 
    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),
Ejemplo n.º 37
0
from rest_framework.authtoken.views import obtain_auth_token

from .forms import EmailValidationOnForgotPasswordForm, LoginForm
from .views import profile_change, role_change, signup, signup_with_email

app_name = 'accounts'

# Built-in views from django.contrib.auth.urls with a little customization applied.
urlpatterns = [
    path('login/', LoginView.as_view(form_class=LoginForm), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('password-change/', PasswordChangeView.as_view(
        success_url=reverse_lazy('accounts:password_change_done')), name='password_change'
    ),
    path('password-change/done/', PasswordChangeDoneView.as_view(), name='password_change_done'),
    path('password-reset/', PasswordResetView.as_view(
        form_class=EmailValidationOnForgotPasswordForm, success_url=reverse_lazy('accounts:password_reset_done')), name='password_reset'
    ),
    path('password-reset/done/', PasswordResetDoneView.as_view(), name='password_reset_done'),
    path('reset/<uidb64>/<token>/', PasswordResetConfirmView.as_view(
        success_url=reverse_lazy('accounts:password_reset_complete')), name='password_reset_confirm'
    ),
    path('reset/done/', PasswordResetCompleteView.as_view(), name='password_reset_complete'),
]

# Custom views about signup.
urlpatterns += [
    path('signup/', signup, name='signup'),
    path(
        'signup/with-chief-email/',
        signup_with_email,
        kwargs={'email_endswith_strings': ['@chief.com.tw']},
Ejemplo n.º 38
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()
Ejemplo n.º 39
0
urlpatterns = [
    # Profile
    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'),
Ejemplo n.º 40
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
Ejemplo n.º 41
0
        'password_change/',
        PasswordChangeView.as_view(
            template_name='accounts/password_change.html',
            success_url=reverse_lazy('accounts:password_change_done')
        ),
        name='password_change'
    ),

    # Reset password
    path(
        'password_reset/',
        PasswordResetView.as_view(
            template_name='accounts/password_reset/'
            'password_reset.html',
            subject_template_name='accounts/password_reset/'
            'email_subject.txt',
            email_template_name='accounts/password_reset/'
            'email_message.html',
            success_url=reverse_lazy('accounts:password_reset_done')
        ),
        name='password_reset'
    ),
    path(
        'password_reset/done/',
        PasswordResetDoneView.as_view(
            template_name='accounts/password_reset/'
            'email_sent.html',
        ),
        name='password_reset_done'
    ),
    path(
Ejemplo n.º 42
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')
]
Ejemplo n.º 43
0
urlpatterns = [
    path("", views.index, name="index"),
    path("dashboard/", views.DashboardView.as_view(), name="dashboard"),
    path("profile/", views.UpdateProfileView.as_view(), name="profile"),
    path("help/", views.HelpView.as_view(), name="help"),
    path("accounts/postlogin/", views.postlogin, name="postlogin"),
    path(
        "accounts/register/",
        views.CustomRegistrationView.as_view(),
        name="django_registration_register",
    ),
    path(
        "accounts/password_reset/",
        PasswordResetView.as_view(
            template_name="registration/password_reset_form.html",
            html_email_template_name=
            "registration/new_password_reset_email.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/reset/<uidb64>/<token>/",
        PasswordResetConfirmView.as_view(
            template_name="registration/password_reset_confirm.html"),
        name="password_reset_confirm",
Ejemplo n.º 44
0
 def test_PasswordResetView(self):
     response = PasswordResetView.as_view(success_url='dummy/')(self.request)
     self.assertContains(response, '<title>Password reset</title>')
     self.assertContains(response, '<h1>Password reset</h1>')
Ejemplo n.º 45
0
    PasswordResetConfirmView,
    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)), ]
Ejemplo n.º 46
0
import messages.views as messages
import accounts.views as accounts
from accounts.forms import FsAuthenticationForm, FsPasswordResetForm
import bookmarks.views as bookmarks
import follow.views as follow
import apiv2.views as api

# By putting some URLs at the top that are the same as the ones listed in
# django.contrib.auth.urls, we can override some configuration:
# https://docs.djangoproject.com/en/1.11/topics/http/urls/#how-django-processes-a-request
# 3. Django runs through each URL pattern, in order, and stops at the first one that matches the requested URL.
urlpatterns = [
    url(r'^login/$', login_redirect(accounts.login), {'template_name': 'registration/login.html',
                                       'authentication_form': FsAuthenticationForm}, name="accounts-login"),
    url(r'^cleanup/$', accounts.multi_email_cleanup, name="accounts-multi-email-cleanup"),
    url(r'^password_reset/$', login_redirect(PasswordResetView.as_view(form_class=FsPasswordResetForm)), name='password_reset'),
    url('^', include('django.contrib.auth.urls')),  # Include logout and reset email urls
    url(r'^register/$', login_redirect(accounts.registration), name="accounts-register"),
    url(r'^reactivate/$', login_redirect(accounts.resend_activation), name="accounts-resend-activation"),
    url(r'^username/$', login_redirect(accounts.username_reminder), name="accounts-username-reminder"),
    url(r'^activate/(?P<username>[^\/]+)/(?P<uid_hash>[^\/]+)/.*$', login_redirect(accounts.activate_user), name="accounts-activate"),
    url(r'^resetemail/$', accounts.email_reset, name="accounts-email-reset"),
    url(r'^resetemail/sent/$', accounts.email_reset_done, name="accounts-email-reset-done"),
    url(r'^resetemail/complete/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>.+)/$', accounts.email_reset_complete, name="accounts-email-reset-complete"),
    url(r'^bulklicensechange/$', accounts.bulk_license_change, name="bulk-license-change"),
    url(r'^tosacceptance/$', accounts.tos_acceptance, name="tos-acceptance"),
    url(r'^check_username/$', accounts.check_username, name="check_username"),

    url(r'^$', accounts.home, name="accounts-home"),
    url(r'^edit/$', accounts.edit, name="accounts-edit"),
    url(r'^email-settings/$', accounts.edit_email_settings, name="accounts-email-settings"),
Ejemplo n.º 47
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.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
    path('admin/', admin.site.urls),
    path('', include('users.urls')),
    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'),
    path('api-auth/', include('rest_framework.urls')),
    path('tinymce/', include('tinymce.urls')),
Ejemplo n.º 48
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'),
)
Ejemplo n.º 49
0
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'),
        name='error_account_exists'
    ),
    url(
        r'^error/account-does-not-exist/?$',
        TemplateView.as_view(template_name='registration/error/account-does-not-exist.html'),
        name='error_account_does_not_exist'