Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
J
janang_reading
Project
Project
Details
Activity
Releases
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
Jan Ericsson Ong Ang
janang_reading
Commits
fd8e27b8
Commit
fd8e27b8
authored
Mar 28, 2023
by
Jan Ericsson Ong Ang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Edits on urls.py
parent
690adcb5
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
10 additions
and
8 deletions
+10
-8
urls.cpython-310.pyc
janang_reading/bookshelf/__pycache__/urls.cpython-310.pyc
+0
-0
views.cpython-310.pyc
janang_reading/bookshelf/__pycache__/views.cpython-310.pyc
+0
-0
urls.py
janang_reading/bookshelf/urls.py
+5
-5
views.py
janang_reading/bookshelf/views.py
+2
-2
settings.cpython-310.pyc
...ading/janang_reading/__pycache__/settings.cpython-310.pyc
+0
-0
settings.py
janang_reading/janang_reading/settings.py
+3
-1
No files found.
janang_reading/bookshelf/__pycache__/urls.cpython-310.pyc
View file @
fd8e27b8
No preview for this file type
janang_reading/bookshelf/__pycache__/views.cpython-310.pyc
View file @
fd8e27b8
No preview for this file type
janang_reading/bookshelf/urls.py
View file @
fd8e27b8
...
@@ -4,9 +4,9 @@ from .views import HomeView, AuthorView, AuthorDetailView, BooksView, BookDetail
...
@@ -4,9 +4,9 @@ from .views import HomeView, AuthorView, AuthorDetailView, BooksView, BookDetail
# url for bookshelf
# url for bookshelf
urlpatterns
=
[
urlpatterns
=
[
path
(
''
,
HomeView
.
as_view
(),
name
=
'home
page
'
),
path
(
''
,
HomeView
.
as_view
(),
name
=
'home'
),
path
(
'author
'
,
AuthorView
.
as_view
(),
name
=
'author-list
'
),
path
(
'author
/'
,
AuthorView
.
as_view
(),
name
=
'author
'
),
path
(
'author/<int:pk>'
,
AuthorDetailView
.
as_view
(),
name
=
'author-detail'
),
path
(
'author/<int:pk>
/
'
,
AuthorDetailView
.
as_view
(),
name
=
'author-detail'
),
path
(
'books
'
,
BooksView
.
as_view
(),
name
=
'books-list
'
),
path
(
'books
/'
,
BooksView
.
as_view
(),
name
=
'books
'
),
path
(
'books/<int:pk>'
,
BookDetailView
.
as_view
(),
name
=
'books-detail'
),
path
(
'books/<int:pk>
/
'
,
BookDetailView
.
as_view
(),
name
=
'books-detail'
),
]
]
\ No newline at end of file
janang_reading/bookshelf/views.py
View file @
fd8e27b8
...
@@ -8,11 +8,11 @@ from .models import Author, Books
...
@@ -8,11 +8,11 @@ from .models import Author, Books
class
HomeView
(
View
):
class
HomeView
(
View
):
def
get
(
self
,
request
):
def
get
(
self
,
request
):
return
render
(
request
,
'bookshelf/home.html'
,
{
'nickname'
:
'Jan'
})
return
render
(
request
,
'bookshelf/
templates/bookshelf/
home.html'
,
{
'nickname'
:
'Jan'
})
class
AuthorView
(
ListView
):
class
AuthorView
(
ListView
):
model
=
Author
model
=
Author
template_name
=
'bookshelf/author.html'
template_name
=
'bookshelf/
templates/bookshelf/
author.html'
class
AuthorDetailView
(
DetailView
):
class
AuthorDetailView
(
DetailView
):
model
=
Author
model
=
Author
...
...
janang_reading/janang_reading/__pycache__/settings.cpython-310.pyc
View file @
fd8e27b8
No preview for this file type
janang_reading/janang_reading/settings.py
View file @
fd8e27b8
...
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
...
@@ -11,6 +11,7 @@ https://docs.djangoproject.com/en/4.1/ref/settings/
"""
"""
from
pathlib
import
Path
from
pathlib
import
Path
import
os
# Build paths inside the project like this: BASE_DIR / 'subdir'.
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
BASE_DIR
=
Path
(
__file__
)
.
resolve
()
.
parent
.
parent
...
@@ -116,7 +117,8 @@ USE_TZ = True
...
@@ -116,7 +117,8 @@ USE_TZ = True
# Static files (CSS, JavaScript, Images)
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL
=
'/static/'
STATIC_URL
=
'/templates/'
STATICFILES_DIRS
=
[
os
.
path
.
join
(
BASE_DIR
,
'templates'
)]
# Default primary key field type
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
...
...
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