Add login and home page
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
from django.shortcuts import render
|
||||
from typing import Any
|
||||
from django.contrib.auth.mixins import LoginRequiredMixin
|
||||
from django.views.generic import TemplateView
|
||||
|
||||
# Create your views here.
|
||||
class HomePage(LoginRequiredMixin, TemplateView):
|
||||
template_name = "notes/home.html"
|
||||
|
||||
def get_context_data(self, **kwargs: Any) -> dict[str, Any]:
|
||||
ctx = super().get_context_data(**kwargs)
|
||||
ctx['notes'] = self.request.user.alive_received_notes
|
||||
return ctx
|
||||
|
||||
Reference in New Issue
Block a user