22 lines
690 B
Python
22 lines
690 B
Python
from django.shortcuts import render
|
|
from django.views.generic import TemplateView
|
|
from django.contrib.auth.mixins import LoginRequiredMixin #, PermissionRequiredMixin
|
|
from django.utils import timezone
|
|
|
|
|
|
|
|
# Create your views here.
|
|
|
|
def Home(request):
|
|
context = { 'ok':'ok', }
|
|
return render(request,'Login/Home.html',context )
|
|
|
|
class Dashboard(LoginRequiredMixin, TemplateView):
|
|
template_name = 'Login/Dashboard.html'
|
|
def get_context_data(self, **kwargs):
|
|
context = super().get_context_data(**kwargs)
|
|
Day = timezone.localtime(timezone.now())
|
|
context['User'] = self.request.user.username.capitalize()
|
|
context['Day'] = Day
|
|
return context
|