Commit d227cad9 authored by Brendan Fausto's avatar Brendan Fausto

About & Models finished, app integrated to project

parent e46bcd0c
from django.db import models
# Create your models here.
class Artist(models.Model): #java eq: class IndexCard extends models.Model
artist_name = models.CharField(max_length=255)
monthly_listeners = models.IntegerField()
class Album(models.Model):
album_name = models.CharField(max_length=255)
artist = models.ForeignKey('Artist', on_delete=models.PROTECT)
description = models.TextField()
release_date = models.DateField()
class Song(models.Model):
song_title = models.CharField(max_length=255)
artist = models.ForeignKey('Artist', on_delete=models.PROTECT)
album = models.ForeignKey('Album', on_delete=models.PROTECT)
song_length = models.TimeField()
\ No newline at end of file
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name='index'),
]
app_name = "about" # for proper namespacing in urls, otherwise will result in errors
\ No newline at end of file
from django.shortcuts import render
from django.http import HttpResponse
def index(request):
return HttpResponse("My name is Brendan Gabrielle M. Fausto, and I\'m a 3rd year BS CS student. \nMy music preferences are very broad, from indie pop to R&B and the occasional metal.")
# Create your views here.
......@@ -45,6 +45,7 @@ INSTALLED_APPS = [
'django.contrib.staticfiles',
'homepage',
'contact'
'about'
]
MIDDLEWARE = [
......
......@@ -19,5 +19,6 @@ from django.urls import path
urlpatterns = [
path('admin/', admin.site.urls),
path('homepage/', include('homepage.urls', namespace="homepage")),
path('contact/', include('contact.urls', namespace="contact"))
path('contact/', include('contact.urls', namespace="contact")),
path('about/', include('about.urls', namespace="about"))
]
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