Exemplo 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)
Exemplo 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'
        )
    ]
Exemplo 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)
Exemplo 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)
Exemplo 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>')
Exemplo n.º 6
0
urlpatterns = [
    path('admin/', admin.site.urls),
    path('om-oss/',
         TemplateView.as_view(template_name="pages/about.html"),
         name="about"),
    path('contakt/',
         TemplateView.as_view(template_name="pages/contact.html"),
         name="contact"),
    path('spelare/', include('hittalaget.players.urls', namespace='player')),
    path('lag/', include('hittalaget.teams.urls', namespace='team')),
    path('annonser/', include('hittalaget.ads.urls', namespace='ad')),
    path('konversationer/',
         include('hittalaget.conversations.urls', namespace='conversation')),
    path('reset-password/',
         PasswordResetView.as_view(from_email="*****@*****.**"),
         name="password_reset"),
    path('reset-password/email-sent/',
         PasswordResetDoneView.as_view(),
         name="password_reset_done"),
    path('reset-password/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(form_class=SetPasswordForm2),
         name="password_reset_confirm"),
    path('reset-password/done/',
         PasswordResetCompleteView.as_view(),
         name="password_reset_complete"),
    path('',
         TemplateView.as_view(template_name="pages/index.html"),
         name="index"),
    path('', include('hittalaget.users.urls', namespace="user")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
Exemplo n.º 7
0
app_name = 'accounts'

urlpatterns = [
    path('login/',
         LoginView.as_view(template_name='accounts/login.html'),
         name='login'),
    path('logout/',
         LogoutView.as_view(template_name='accounts/logout.html'),
         name='logout'),
    path('register/', register, name='register'),
    path('profile/', view_profile, name='view_profile'),
    path('profile/edit/', edit_profile, name='edit_profile'),
    path('change-password', change_password, name='change_password'),
    path('reset-password',
         PasswordResetView.as_view(
             template_name='accounts/reset_password.html',
             email_template_name='accounts/reset_password_email.html',
             success_url=reverse_lazy('accounts:password_reset_done')),
         name='reset_password'),
    path('reset-password/done',
         PasswordResetDoneView.as_view(
             template_name='accounts/reset_password_done.html'),
         name='password_reset_done'),
    path('reset-password/confirm/<uidb64>/<token>',
         PasswordResetConfirmView.as_view(
             template_name='accounts/reset_password_confirm.html',
             success_url=reverse_lazy('accounts:password_reset_complete')),
         name='password_reset_confirm'),
    path('reset/done',
         PasswordResetCompleteView.as_view(
             template_name='accounts/reset_password_complete.html'),
         name='password_reset_complete'),
Exemplo n.º 8
0
from django.conf.urls import url, include
from django.contrib.auth import views as auth_views
from . import views
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

app_name = 'accounts'
urlpatterns = [
    url(r'^login/$',
        auth_views.LoginView.as_view(template_name='accounts/login.html'),
        name='login'),
    url(r'^logout/$', auth_views.LogoutView.as_view(), name='logout'),
    url(r'^signup/$', views.SignUp.as_view(), name='signup'),
    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')
]
Exemplo 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'),
Exemplo n.º 10
0
from .views import (
    SignUpView, 
)



urlpatterns = [
    path('', SignUpView, name='signup'),
    path('logout/', LogoutView.as_view(next_page = 'login'), name = 'logout'),

    path('login/', 
        LoginView.as_view(template_name = 'users/login.html', redirect_authenticated_user = True), 
        name = 'login'),
    
    path("password-reset/",
     	PasswordResetView.as_view(template_name='users/password_reset.html'),
    	name="password_reset"),

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

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

	path("password-reset-complete/", 
		PasswordResetCompleteView.as_view(template_name='users/password_reset_complete.html'), 
		name="password_reset_complete"),
]
Exemplo n.º 11
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'),
Exemplo n.º 12
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']},
Exemplo n.º 13
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'),
]
Exemplo 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>.+?)/$'),
Exemplo n.º 15
0
    path('index', views.index, name='index'),
    path('contact', views.contact, name='contact'),
    path('download', views.download, name='llamas_download'),
    path('submission', views.submission, name='submission'),
    path('labelling', views.labelling, name='labelling'),
    path('benchmarks', views.benchmarks, name='benchmarks'),
    path('benchmark_binary', views.benchmark_binary, name='benchmark_binary'),
    path('benchmark_multi', views.benchmark_multi, name='benchmark_multi'),
    path('benchmark_splines',
         views.benchmark_splines,
         name='benchmark_splines'),
    path('imprint', views.imprint, name='imprint'),
    path('signup', views.signup_view, name='signup'),
    path('login/',
         LoginView.as_view(template_name='llamas/login.html'),
         name='login'),
    path('password_reset/',
         PasswordResetView.as_view(
             template_name='llamas/general_form.html',
             extra_context={'form_name': 'Reset Password'},
             success_url='/llamas/'),
         name='password_reset'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(
             template_name='llamas/general_form.html',
             extra_context={'form_name': 'Reset Password'},
             post_reset_login=True,
             success_url='/llamas/'),
         name='password_reset_confirm'),
]
Exemplo n.º 16
0
from django.urls import path, re_path
from django.urls import include
from django.contrib.auth.views import (PasswordResetView,
                                       PasswordResetDoneView,
                                       PasswordResetConfirmView,
                                       PasswordResetCompleteView, TemplateView)

from . import views

urlpatterns = [
    path("", views.login_view, name="default"),
    path("login/", views.login_view, name="login"),
    path("signup/", views.signup, name="signup"),
    path("logout/", views.logout_view, name="logout"),
    path('reset-password/', PasswordResetView.as_view(),
         name='reset_password'),
    path('reset-password/done',
         PasswordResetDoneView.as_view(),
         name="password_reset_done"),
    re_path(
        r'^reset-password/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
        PasswordResetConfirmView.as_view(),
        name="password_reset_confirm"),
    path('reset-password/complete',
         PasswordResetCompleteView.as_view(),
         name="password_reset_complete")
]
Exemplo n.º 17
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(
Exemplo n.º 18
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",
Exemplo n.º 19
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)), ]
Exemplo 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')),
]
Exemplo n.º 21
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"),
Exemplo n.º 22
0
Arquivo: urls.py Projeto: 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'),
    ]   
Exemplo n.º 23
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'),
Exemplo 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'),
]
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')
]
Exemplo n.º 26
0
      LoginView.as_view(template_name='registration/login.html'),
      name='login'),
 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'),
Exemplo n.º 27
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')
]

Exemplo n.º 28
0
from django.contrib.auth.views import LoginView, logout_then_login, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
# password_reset_done,password_reset_confirm,password_reset_complete
# from django.contrib.auth import views as auth_views

urlpatterns = [
    path('admin/', admin.site.urls),
    path('mascota/', include('apps.mascota.urls')),
    path('adopcion/', include('apps.adopcion.urls')),
    path('usuario/', include('apps.usuario.urls')),
    path('accounts/login/',
         LoginView.as_view(template_name='index.html'),
         name='login'),
    path('logout/', logout_then_login, name='logout'),
    path('reset/password_reset',
         PasswordResetView.as_view(
             template_name='registration/password_reset_form.html',
             email_template_name='registration/password_reset_email.html'),
         name='password_reset'),
    path('reset/password_reset_done',
         PasswordResetDoneView.as_view(
             template_name='registration/password_reset_done.html'),
         name='password_reset_done'),
    path('reset/reset/<uidb64>/<token>/ ',
         PasswordResetConfirmView.as_view(
             template_name='registration/password_reset_confirm.html'),
         name='password_reset_confirm'),

    # 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_complete.html'),
Exemplo n.º 29
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    
Exemplo n.º 30
0
from . import views
from django.contrib.auth.views import LoginView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

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

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

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

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

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

    path('post/<int:pk>/', views.post_detail, name='post_detail'),
    path('post/new', views.post_new, name='post_new'),
    path('post/<int:pk>/edit/', views.post_edit, name='post_edit'),
    #api
    url(r'^api/', include(router.urls)),
    url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
    #---fin api
]
Exemplo n.º 31
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')
]
Exemplo n.º 32
0
    'subject_template_name': 'users/password_reset/subject.txt',
    'success_url': reverse_lazy('login'),
}

password_set_params = {
    'template_name': 'users/password_set.html',
    'post_reset_login': True,
    'success_url': reverse_lazy('root'),
}

urlpatterns = [
    path('', lambda request: redirect('books:index'), name='root'),
    # path('/403/', permission_denied, name='permission_denied'),
    path('login/', LoginView.as_view(**login_params), name='login'),
    path('logout/', LogoutView.as_view(), name='logout'),
    path('register/', register, name='register'),
    path('password-reset/',
         PasswordResetView.as_view(**password_reset_params),
         name='password_reset'),
    path('password-set/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(**password_set_params),
         name='password_set'),
    path('tutorial/', include('tutorial.urls')),
    path('books/', include('books.urls')),
    path('api/', include('api.urls')),
    path('jet/', include('jet.urls', 'jet')),
    path('admin/', admin.site.urls),
]

handler403 = permission_denied
    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),
Exemplo n.º 34
0
from django.urls import path
from django.contrib.auth.views import PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView
from .views import AccountsView

urlpatterns = [
    path('login/', AccountsView.user_login),
    path('logout/', AccountsView.user_logout),
    path('register/', AccountsView.register),
    path('activate/', AccountsView.activate_account),
    path('reset_password/',
         PasswordResetView.as_view(template_name='password/reset.html'),
         name='reset_password'),
    path('reset_password_sent/',
         PasswordResetDoneView.as_view(template_name='password/sent.html'),
         name='password_reset_done'),
    path('reset/<uidb64>/<token>/',
         PasswordResetConfirmView.as_view(template_name='password/form.html'),
         name='password_reset_confirm'),
    path('reset_password_complete/',
         PasswordResetCompleteView.as_view(template_name='password/done.html'),
         name='password_reset_complete'),
]
Exemplo n.º 35
0
from django.urls import path
from django.conf.urls import url
from . import views
from django.contrib.auth.views import LoginView, 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

urlpatterns = [
    url(r'^signup/$', views.signup_view, name="signup"),
    url(r'^loginpage/$',
        LoginView.as_view(template_name="login/loginpage.html"),
        name="loginpage"),
    url(r'^logoutpage/$',
        LogoutView.as_view(template_name="login/logoutpage.html"),
        name="logoutpage"),
    url(r'^emailPassword/$',
        PasswordResetView.as_view(template_name="login/loginpage.html"),
        name="emailPassword"),
    url(r'^emailPasswordDone/$',
        PasswordResetDoneView.as_view(template_name="login/loginpage.html"),
        name="emailPasswordDone"),
    url(r'^emailPasswordConfirm/(?P<uidb64>[0-9A-Za-z_\-]+)/(?P<token>[0-9A-Za-z]{1,13}-[0-9A-Za-z]{1,23})/$',
        PasswordResetConfirmView,
        name="password_reset_confirm"),
    url(r'^reset/$',
        PasswordResetView.as_view(template_name="login/loginpage.html"),
        name="password_reset_complete"),
]
Exemplo n.º 36
0
 _(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'),
         ])),
Exemplo n.º 37
0
from django.contrib.auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, \
    PasswordResetConfirmView, PasswordResetCompleteView
from django.urls import path, include
from django.views.generic import TemplateView
from django_registration.backends.activation.views import RegistrationView, ActivationView

from accounts.forms import CustomUserCreationForm

urlpatterns = [
    path('login/', LoginView.as_view(), name='login'),
    path('logout/',
         LogoutView.as_view(template_name='registration/logout.html'),
         name='logout'),
    path('password-reset/', PasswordResetView.as_view(),
         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'),
    path('register/',
         RegistrationView.as_view(
             success_url='/',
             form_class=CustomUserCreationForm,
             template_name='registration/registration_form.html',
             email_body_template='registration/activation_email.txt',
             email_subject_template='registration/activation_email_subject.txt'
Exemplo 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()
Exemplo n.º 39
0
from django.conf import settings
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, include
from condor.views import GenericViewLanding, SignupView
from django.contrib.auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", GenericViewLanding.as_view(), name="landing_page"),
    path("signup/", SignupView.as_view(), name="signup"),
    path("leads/", include("condor.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("reset-password/", PasswordResetView.as_view(),
         name="password-reset"),
    path("reset-password-done/",
         PasswordResetDoneView.as_view(),
         name="password_reset_done"),
    path("password-reset-confirm/<uidb64>/<token>/",
         PasswordResetConfirmView.as_view(),
         name="password-reset-confirm"),
    path("reset-password-complete/",
         PasswordResetCompleteView.as_view(),
         name="password_reset_complete"),
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL,
                          document_root=settings.STATIC_ROOT)
Exemplo 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
Exemplo n.º 41
0
from django.contrib import admin
from django.urls import path, include
from core.views import LandingPageView, Signupview
from django.conf import settings
from django.conf.urls.static import static
from django.contrib.auth.views import LoginView, LogoutView, PasswordResetView, PasswordResetDoneView, PasswordResetConfirmView, PasswordResetCompleteView

urlpatterns = [
    path('admin/', admin.site.urls),
    path("", LandingPageView.as_view(), name="landing_page"),
    path("leads/", include("core.urls", namespace="core")),
    # all django built in view
    path("login/", LoginView.as_view(), name="login"),
    path("logout/", LogoutView.as_view(), name="logout"),
    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"),

    # end of all djnago built in views
    path("signup/", Signupview.as_view(), name="signup"),
    path("agents/", include('agents.urls', namespace="agents")),
]
Exemplo 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')
]
Exemplo n.º 43
0
The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/3.0/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
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 logapp import views
from django.contrib.auth.views import PasswordResetView,PasswordResetDoneView,PasswordResetConfirmView,PasswordResetCompleteView
urlpatterns = [
    path('',views.user_form_view,name='register'),
    path('admin/', admin.site.urls),
    path('user_login/',views.user_login, name='user_login'),
    path('logout/',views.user_logout, name='logout'),
    path('index/',views.index,name='index'),

    path('password-reset/', PasswordResetView.as_view(), 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')
]
Exemplo 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>')
Exemplo n.º 45
0
from django.conf.urls import url,include
from first import views
from django.contrib import admin
from django.contrib.auth.views import LoginView,PasswordResetView,PasswordResetDoneView,PasswordResetConfirmView,PasswordResetCompleteView
urlpatterns=[
    url(r'login/$',LoginView.as_view(template_name="Registration/LoginView.html",extra_context={'passworreset':'false'}),name="login"),
    url(r'register/$',views.registration,name="register"),
    url(r'^password_reset/$', PasswordResetView.as_view(template_name='Registration/password_reset_form.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'^password_reset/confirm/(?P<uidb64>[0-9A-Za-z]+)-(?P<token>.+)/$',
        PasswordResetConfirmView.as_view(template_name='Registration/password_reset_confirm.html'), name='password_reset_confirm'),
    url(r'^password_reset/compleate$', LoginView.as_view(template_name='Registration/LoginView.html',extra_context={'passworreset':'false'}), name='password_reset_complete'),
    url(r'^logedin/$',views.logedin,name="logedin"),
    url(r'^$',views.index,name="startap"),

]
Exemplo 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"),
Exemplo n.º 47
0
from django.contrib.auth import views as auth_views
from django.contrib.auth.views import LoginView, PasswordResetView, PasswordResetConfirmView, PasswordResetDoneView, PasswordResetCompleteView, LogoutView
from .views import ProfileDetailView

urlpatterns = [
    path('', ProfileDetailView.as_view(), name="detail"),
    path('login/',
         LoginView.as_view(template_name='user/login.html',
                           redirect_authenticated_user=True),
         name="login"),
    path('logout/',
         LogoutView.as_view(template_name='user/logout.html'),
         name="logout"),
    path('password_reset/',
         PasswordResetView.as_view(
             template_name='user/password_reset.html',
             email_template_name='user/password_reset_email.html',
             success_url=reverse_lazy('user:password_reset_done')),
         name='password_reset'),
    path('password_reset/done',
         PasswordResetDoneView.as_view(
             template_name='user/password_reset_done.html'),
         name='password_reset_done'),
    re_path(
        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='user/password_reset_confirm.html',
            success_url=reverse_lazy('user:password_reset_complete')),
        name='password_reset_confirm'),
    path('reset/done',
         PasswordResetCompleteView.as_view(
             template_name='user/password_reset_complete.html'),
Exemplo 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'),
)
Exemplo 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'