From e3d42d0109e087e48f2fd695dcedb510848ecf53 Mon Sep 17 00:00:00 2001
From: Frederic Blinkenbunt Account Manager
+ Logged out
You have been logged out.
Your username and password didn't match. Please try again.
+{% endif %} + +{% if next %} + {% if user.is_authenticated %} +Your account doesn't have access to this page. To proceed, + please login with an account that has access.
+ {% else %} +Please login to see this page.
+ {% endif %} +{% endif %} + + +{% endblock %} diff --git a/bam/templates/bam/password_change.html b/bam/templates/bam/password_change.html new file mode 100644 index 0000000..721f770 --- /dev/null +++ b/bam/templates/bam/password_change.html @@ -0,0 +1,32 @@ +{% extends "bam/base.html" %} +{% block content-extra-head %} + +{% endblock %} +{% block content %} ++
+ +{% endblock %} diff --git a/bam/templates/bam/profile.html b/bam/templates/bam/profile.html new file mode 100644 index 0000000..c0dab0d --- /dev/null +++ b/bam/templates/bam/profile.html @@ -0,0 +1,4 @@ +{% extends "bam/base.html" %} +{% block content %} +Your username and password didn't match. Please try again.
-{% endif %} - -{% if next %} - {% if user.is_authenticated %} -Your account doesn't have access to this page. To proceed, - please login with an account that has access.
- {% else %} -Please login to see this page.
- {% endif %} -{% endif %} - - - -{# Assumes you setup the password_reset view in your URLconf #} - - -{% endblock %} diff --git a/bam/urls.py b/bam/urls.py index 1a66007..6c3b655 100644 --- a/bam/urls.py +++ b/bam/urls.py @@ -3,9 +3,47 @@ from django.urls import path from django.urls import include from django.views.generic.base import RedirectView from bam.views import ProfileView +import django.contrib.auth.views as auth_views urlpatterns = [ - path('accounts/profile/', ProfileView.as_view(), name='profile'), - path('accounts/', include('django.contrib.auth.urls')), + path('accounts/profile/', RedirectView.as_view(pattern_name='profile')), path('', RedirectView.as_view(pattern_name='profile')), + path('profile/', ProfileView.as_view(), name='profile'), + + path('login/', + auth_views.LoginView.as_view(template_name='bam/login.html'), + name='login'), + path('logout/', + auth_views.LogoutView.as_view(template_name='bam/logged_out.html'), + name='logout'), + path('password_change/', + auth_views.PasswordChangeView.as_view( + template_name='bam/password_change.html' + ), + name='password_change'), + path('password_change_done/', + auth_views.PasswordChangeDoneView.as_view( + template_name='bam/password_change_done.html' + ), + name='password_change_done'), + path('password_reset/', + auth_views.PasswordResetView.as_view( + template_name='bam/password_reset.html' + ), + name='password_reset'), + path('password_reset_done/', + auth_views.PasswordResetDoneView.as_view( + template_name='bam/password_reset_done.html' + ), + name='password_reset_done'), + path('password_reset_confirm/', + auth_views.PasswordResetConfirmView.as_view( + template_name='bam/password_reset_confirm.html' + ), + name='password_reset_confirm'), + path('password_reset_complete/', + auth_views.PasswordResetCompleteView.as_view( + template_name='bam/password_reset_complete.html' + ), + name='password_reset_complete'), ] diff --git a/bam/views.py b/bam/views.py index d8894d5..5a9f665 100644 --- a/bam/views.py +++ b/bam/views.py @@ -2,4 +2,4 @@ from django.views.generic.base import TemplateView from django.contrib.auth.mixins import LoginRequiredMixin class ProfileView(LoginRequiredMixin, TemplateView): - template_name = 'profile.html' + template_name = 'bam/profile.html'