Commit 72b8375a authored by impfundev's avatar impfundev

fix: shifting homepage from function bases to class based views

parent 25dbefd5
...@@ -18,10 +18,10 @@ Including another URLconf ...@@ -18,10 +18,10 @@ Including another URLconf
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path
from django.conf.urls import include from django.conf.urls import include
from dashboards.views import home from dashboards.views import HomePage
urlpatterns = [ urlpatterns = [
path("", home, name="homepage"), path("", HomePage.as_view(), name="homepage"),
path("dashboard/", include("dashboards.urls")), path("dashboard/", include("dashboards.urls")),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("auth/", include("authentications.urls")), path("auth/", include("authentications.urls")),
......
from django.db.models import Q from django.db.models import Q
from django.views.generic import ListView from django.views.generic import ListView, TemplateView
from django.shortcuts import render from django.shortcuts import render
from datetime import datetime, timedelta from datetime import datetime, timedelta
...@@ -74,8 +74,8 @@ class UpcomingLoanView(ListView): ...@@ -74,8 +74,8 @@ class UpcomingLoanView(ListView):
return queryset return queryset
def home(request): class HomePage(TemplateView):
return render(request, "homepage.html") template_name = "homepage.html"
def index(request): def index(request):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment