django-musician/musician/views.py

21 lines
654 B
Python
Raw Normal View History

2019-10-25 11:33:37 +00:00
from django.contrib.auth.mixins import LoginRequiredMixin
2019-10-10 07:18:34 +00:00
from django.shortcuts import render
from django.urls import reverse_lazy
2019-10-25 11:33:37 +00:00
from django.views.generic.base import TemplateView
from django.views.generic.edit import FormView
2019-10-10 07:18:34 +00:00
from . import api, get_version
from .forms import LoginForm
2019-10-25 11:33:37 +00:00
from .mixins import CustomContextMixin
class DashboardView(CustomContextMixin, TemplateView): ## TODO LoginRequiredMixin
template_name = "musician/dashboard.html"
class LoginView(FormView):
template_name = 'auth/login.html'
form_class = LoginForm
success_url = reverse_lazy('musician:dashboard')
extra_context = {'version': get_version()}