Added models to the models.py in homepage

parent 90fdc70d
from django.urls import path
from.import views
urlpatterns = {
path('', views.index, name = "index"),
}
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
# Create your views here. # Create your views here.
def index(request):
return HttpResponse ("My music tastes includes pop songs, opms and edms. Some of my favorite artists includes Taylor Swift, Ben and Ben, and Zack Tabuldo.")
from django.urls import path
from.import views
urlpatterns = {
path('', views.index, name = "index"),
}
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
# Create your views here. # Create your views here.
def index(request):
return HttpResponse("These are my contact info: email: enrico.suplico@obf.ateneo.edu, phone number: +6312345678912")
...@@ -14,8 +14,11 @@ Including another URLconf ...@@ -14,8 +14,11 @@ Including another URLconf
2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) 2. Add a URL to urlpatterns: path('blog/', include('blog.urls'))
""" """
from django.contrib import admin from django.contrib import admin
from django.urls import path from django.urls import path, include
urlpatterns = [ urlpatterns = [
path('homepage/', include("homepage.urls")),
path('about/', include("about.urls")),
path('contact/', include("contact.urls")),
path('admin/', admin.site.urls), path('admin/', admin.site.urls),
] ]
from django.db import models from django.db import models
# Create your models here. class Artist(models.Model):
artist_name = models.CharField(max_length = 50, unique = True)
monthly_listners = models.IntegerField
class Album(models.Model):
album_name = models.CharField(max_length = 50, unique = True)
artist = models.ForeignKey(Artist, on_delete = models.CASCADE)
description = models.CharField(max_length = 500)
release_date = models.CharField(max_length = 50)
class Song(models.Model):
song_title = models.CharField(max_length = 50, unique = True)
artist = models.ForeignKey(Artist, on_delete = models.CASCADE)
album = models.ForeignKey(album, on_delete = models.CASCADE)
song_length = models.IntegerField
\ No newline at end of file
from django.urls import path
from.import views
urlpatterns = {
path('', views.index, name = "index"),
}
from django.shortcuts import render from django.shortcuts import render
from django.http import HttpResponse
# Create your views here. # Create your views here.
def index(request):
return HttpResponse("Welcome to Enrico's Music Library!")
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