Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
lance_tan_music
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
Lance Cedric Tan
lance_tan_music
Commits
d71e0ec1
Commit
d71e0ec1
authored
Feb 16, 2023
by
Lance Cedric Tan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Accomplished Contact and About apps
parent
5999e1a6
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
220 additions
and
0 deletions
+220
-0
.DS_Store
.DS_Store
+0
-0
0001_initial.py
About/migrations/0001_initial.py
+47
-0
models.py
About/models.py
+46
-0
urls.py
About/urls.py
+10
-0
views.py
About/views.py
+5
-0
0001_initial.py
Contact/migrations/0001_initial.py
+47
-0
models.py
Contact/models.py
+46
-0
urls.py
Contact/urls.py
+10
-0
views.py
Contact/views.py
+5
-0
db.sqlite3
db.sqlite3
+0
-0
settings.py
lance_tan_music/settings.py
+2
-0
urls.py
lance_tan_music/urls.py
+2
-0
No files found.
.DS_Store
View file @
d71e0ec1
No preview for this file type
About/migrations/0001_initial.py
0 → 100644
View file @
d71e0ec1
# Generated by Django 3.2 on 2023-02-16 12:49
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Album'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'album_name'
,
models
.
CharField
(
max_length
=
255
)),
(
'description'
,
models
.
CharField
(
max_length
=
255
)),
(
'release_date'
,
models
.
CharField
(
max_length
=
255
)),
],
),
migrations
.
CreateModel
(
name
=
'Artist'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'artist_name'
,
models
.
CharField
(
max_length
=
255
)),
(
'monthly_listeners'
,
models
.
IntegerField
()),
],
),
migrations
.
CreateModel
(
name
=
'SongInfo'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'song_title'
,
models
.
CharField
(
max_length
=
255
)),
(
'song_length'
,
models
.
IntegerField
()),
(
'album'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'About.album'
)),
(
'artist'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'About.artist'
)),
],
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'artist'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'About.artist'
),
),
]
About/models.py
View file @
d71e0ec1
from
django.db
import
models
from
django.db
import
models
# Create your models here.
# Create your models here.
from
django.db
import
models
from
django.urls
import
reverse
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
255
)
monthly_listeners
=
models
.
IntegerField
()
def
__str__
(
self
):
return
artist_name
def
get_absolute_url
(
self
):
return
reverse
(
'artist'
,
args
=
[
str
(
self
.
artist_name
)])
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
255
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
CharField
(
max_length
=
255
)
release_date
=
models
.
CharField
(
max_length
=
255
)
def
__str__
(
self
):
return
album_name
def
get_absolute_url
(
self
):
return
reverse
(
'album'
,
args
=
[
str
(
self
.
album_name
)])
class
SongInfo
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
255
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
IntegerField
()
def
__str__
(
self
):
return
song_title
def
get_absolute_url
(
self
):
return
reverse
(
'song'
,
args
=
[
str
(
self
.
song_title
)])
About/urls.py
0 → 100644
View file @
d71e0ec1
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
]
app_name
=
"About"
About/views.py
View file @
d71e0ec1
from
django.shortcuts
import
render
from
django.shortcuts
import
render
# Create your views here.
# Create your views here.
from
django.http
import
HttpResponse
def
index
(
request
):
return
HttpResponse
(
"Hi, I'm Lance, and I'm a big fan of J-Rock and J-Metal!"
)
\ No newline at end of file
Contact/migrations/0001_initial.py
0 → 100644
View file @
d71e0ec1
# Generated by Django 3.2 on 2023-02-16 12:48
from
django.db
import
migrations
,
models
import
django.db.models.deletion
class
Migration
(
migrations
.
Migration
):
initial
=
True
dependencies
=
[
]
operations
=
[
migrations
.
CreateModel
(
name
=
'Album'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'album_name'
,
models
.
CharField
(
max_length
=
255
)),
(
'description'
,
models
.
CharField
(
max_length
=
255
)),
(
'release_date'
,
models
.
CharField
(
max_length
=
255
)),
],
),
migrations
.
CreateModel
(
name
=
'Artist'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'artist_name'
,
models
.
CharField
(
max_length
=
255
)),
(
'monthly_listeners'
,
models
.
IntegerField
()),
],
),
migrations
.
CreateModel
(
name
=
'SongInfo'
,
fields
=
[
(
'id'
,
models
.
BigAutoField
(
auto_created
=
True
,
primary_key
=
True
,
serialize
=
False
,
verbose_name
=
'ID'
)),
(
'song_title'
,
models
.
CharField
(
max_length
=
255
)),
(
'song_length'
,
models
.
IntegerField
()),
(
'album'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'Contact.album'
)),
(
'artist'
,
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'Contact.artist'
)),
],
),
migrations
.
AddField
(
model_name
=
'album'
,
name
=
'artist'
,
field
=
models
.
ForeignKey
(
on_delete
=
django
.
db
.
models
.
deletion
.
CASCADE
,
to
=
'Contact.artist'
),
),
]
Contact/models.py
View file @
d71e0ec1
from
django.db
import
models
from
django.db
import
models
# Create your models here.
# Create your models here.
from
django.db
import
models
from
django.urls
import
reverse
class
Artist
(
models
.
Model
):
artist_name
=
models
.
CharField
(
max_length
=
255
)
monthly_listeners
=
models
.
IntegerField
()
def
__str__
(
self
):
return
artist_name
def
get_absolute_url
(
self
):
return
reverse
(
'artist'
,
args
=
[
str
(
self
.
artist_name
)])
class
Album
(
models
.
Model
):
album_name
=
models
.
CharField
(
max_length
=
255
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
description
=
models
.
CharField
(
max_length
=
255
)
release_date
=
models
.
CharField
(
max_length
=
255
)
def
__str__
(
self
):
return
album_name
def
get_absolute_url
(
self
):
return
reverse
(
'album'
,
args
=
[
str
(
self
.
album_name
)])
class
SongInfo
(
models
.
Model
):
song_title
=
models
.
CharField
(
max_length
=
255
)
artist
=
models
.
ForeignKey
(
Artist
,
on_delete
=
models
.
CASCADE
)
album
=
models
.
ForeignKey
(
Album
,
on_delete
=
models
.
CASCADE
)
song_length
=
models
.
IntegerField
()
def
__str__
(
self
):
return
song_title
def
get_absolute_url
(
self
):
return
reverse
(
'song'
,
args
=
[
str
(
self
.
song_title
)])
Contact/urls.py
0 → 100644
View file @
d71e0ec1
from
django.urls
import
path
from
.views
import
index
urlpatterns
=
[
path
(
''
,
index
,
name
=
'index'
),
]
app_name
=
"Contact"
Contact/views.py
View file @
d71e0ec1
from
django.shortcuts
import
render
from
django.shortcuts
import
render
# Create your views here.
# Create your views here.
from
django.http
import
HttpResponse
def
index
(
request
):
return
HttpResponse
(
"You can contact me at: fake@example.com, or text 09080000000000"
)
\ No newline at end of file
db.sqlite3
View file @
d71e0ec1
No preview for this file type
lance_tan_music/settings.py
View file @
d71e0ec1
...
@@ -44,6 +44,8 @@ INSTALLED_APPS = [
...
@@ -44,6 +44,8 @@ INSTALLED_APPS = [
'django.contrib.messages'
,
'django.contrib.messages'
,
'django.contrib.staticfiles'
,
'django.contrib.staticfiles'
,
'Homepage'
,
'Homepage'
,
'About'
,
'Contact'
,
]
]
MIDDLEWARE
=
[
MIDDLEWARE
=
[
...
...
lance_tan_music/urls.py
View file @
d71e0ec1
...
@@ -17,6 +17,8 @@ from django.contrib import admin
...
@@ -17,6 +17,8 @@ from django.contrib import admin
from
django.urls
import
include
,
path
from
django.urls
import
include
,
path
urlpatterns
=
[
urlpatterns
=
[
path
(
'About'
,
include
(
'About.urls'
,
namespace
=
"About"
)),
path
(
'Contact'
,
include
(
'Contact.urls'
,
namespace
=
"Contact"
)),
path
(
'Homepage'
,
include
(
'Homepage.urls'
,
namespace
=
"Homepage"
)),
path
(
'Homepage'
,
include
(
'Homepage.urls'
,
namespace
=
"Homepage"
)),
path
(
'admin/'
,
admin
.
site
.
urls
),
path
(
'admin/'
,
admin
.
site
.
urls
),
]
]
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