Browse Source

add profile view

master
Fr3deric 6 years ago
parent
commit
9fe7b6e9e8
  1. 7
      bam/templates/profile.html
  2. 4
      bam/urls.py
  3. 6
      bam/views.py

7
bam/templates/profile.html

@ -0,0 +1,7 @@ @@ -0,0 +1,7 @@
{% extends "base.html" %}
{% block content %}
<a href="{% url 'password_change' %}">Change password</a>
{% endblock %}

4
bam/urls.py

@ -1,7 +1,11 @@ @@ -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')),
]

6
bam/views.py

@ -1,3 +1,5 @@ @@ -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'

Loading…
Cancel
Save