Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
L
library-app-django
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ilham Maulana
library-app-django
Commits
72b8375a
Commit
72b8375a
authored
Jul 09, 2024
by
impfundev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: shifting homepage from function bases to class based views
parent
25dbefd5
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
urls.py
config/urls.py
+2
-2
views.py
dashboards/views.py
+3
-3
No files found.
config/urls.py
View file @
72b8375a
...
...
@@ -18,10 +18,10 @@ Including another URLconf
from
django.contrib
import
admin
from
django.urls
import
path
from
django.conf.urls
import
include
from
dashboards.views
import
hom
e
from
dashboards.views
import
HomePag
e
urlpatterns
=
[
path
(
""
,
home
,
name
=
"homepage"
),
path
(
""
,
HomePage
.
as_view
()
,
name
=
"homepage"
),
path
(
"dashboard/"
,
include
(
"dashboards.urls"
)),
path
(
"admin/"
,
admin
.
site
.
urls
),
path
(
"auth/"
,
include
(
"authentications.urls"
)),
...
...
dashboards/views.py
View file @
72b8375a
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
datetime
import
datetime
,
timedelta
...
...
@@ -74,8 +74,8 @@ class UpcomingLoanView(ListView):
return
queryset
def
home
(
request
):
return
render
(
request
,
"homepage.html"
)
class
HomePage
(
TemplateView
):
template_name
=
"homepage.html"
def
index
(
request
):
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment