beta v.1.1
This commit is contained in:
21
Base/views/views.py
Normal file
21
Base/views/views.py
Normal file
@@ -0,0 +1,21 @@
|
||||
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
|
||||
Reference in New Issue
Block a user