diff --git a/README.md b/README.md index 00e2c83..803576d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ ## Installation -Currently, this repository does only contain a plain `Django` app without a +Currently, this repository does only contain a plain _Django_ app without a project. The app is not (yet) packaged. Therfore, the following steps are necessary to initialize a development environment: @@ -35,6 +35,14 @@ ln -sr bam PROJECT_DIRECTORY/bam ``` ./manage.py createsuperuser +``` + + 8. Download _Pure.css_ and extract it to `bam/static/`. + + 9. Start the development server: + + ``` +./manage.py runserver ``` ## ToDo diff --git a/bam/templates/bam/base.html b/bam/templates/bam/base.html new file mode 100644 index 0000000..a6f8bee --- /dev/null +++ b/bam/templates/bam/base.html @@ -0,0 +1,75 @@ +{% load static %} + + +
+ + + + {% block content-extra-head %} + {% endblock %} + + +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'