From 9fe7b6e9e820dcbb6c1ea55b00c3b2febfe9ecca Mon Sep 17 00:00:00 2001 From: Frederic Date: Thu, 25 Apr 2019 22:17:58 +0200 Subject: [PATCH] add profile view --- bam/templates/profile.html | 7 +++++++ bam/urls.py | 4 ++++ bam/views.py | 6 ++++-- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 bam/templates/profile.html diff --git a/bam/templates/profile.html b/bam/templates/profile.html new file mode 100644 index 0000000..68a1819 --- /dev/null +++ b/bam/templates/profile.html @@ -0,0 +1,7 @@ +{% extends "base.html" %} + +{% block content %} + +Change password + +{% endblock %} diff --git a/bam/urls.py b/bam/urls.py index 2c12378..1a66007 100644 --- a/bam/urls.py +++ b/bam/urls.py @@ -1,7 +1,11 @@ from django.urls import path from django.urls import include +from django.views.generic.base import RedirectView +from bam.views import ProfileView urlpatterns = [ + path('accounts/profile/', ProfileView.as_view(), name='profile'), path('accounts/', include('django.contrib.auth.urls')), + path('', RedirectView.as_view(pattern_name='profile')), ] diff --git a/bam/views.py b/bam/views.py index 91ea44a..d8894d5 100644 --- a/bam/views.py +++ b/bam/views.py @@ -1,3 +1,5 @@ -from django.shortcuts import render +from django.views.generic.base import TemplateView +from django.contrib.auth.mixins import LoginRequiredMixin -# Create your views here. +class ProfileView(LoginRequiredMixin, TemplateView): + template_name = 'profile.html'