Commit b1b93259 authored by Jose Gabriel L. Salas's avatar Jose Gabriel L. Salas

added homepage which contains the models.py the built models and homepage message

parent 696a78ed
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class HomepageConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'homepage'
# Generated by Django 3.2 on 2023-02-13 14:09
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='IndexCard',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('name', models.CharField(max_length=100)),
('section', models.CharField(max_length=5)),
('age', models.IntegerField()),
],
),
]
# Generated by Django 3.2 on 2023-02-13 14:17
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('homepage', '0001_initial'),
]
operations = [
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=50)),
('monthly_listeners', models.IntegerField()),
],
),
migrations.DeleteModel(
name='IndexCard',
),
]
# Generated by Django 3.2 on 2023-02-13 14:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0002_auto_20230213_2217'),
]
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=100)),
('description', models.CharField(max_length=1000)),
('release_date', models.CharField(max_length=50)),
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.artist')),
],
),
]
# Generated by Django 3.2 on 2023-02-13 14:18
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('homepage', '0003_album'),
]
operations = [
migrations.CreateModel(
name='Song',
fields=[
('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
('song_title', models.CharField(max_length=100)),
('song_length', models.IntegerField()),
('album', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.album')),
('artist', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, to='homepage.artist')),
],
),
]
from django.db import models
class Artist(models.Model):
artist_name = models.CharField(max_length=50)
monthly_listeners = models.IntegerField()
class Album(models.Model):
album_name = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE,related_name = 'album')
description = models.CharField(max_length=1000)
release_date = models.CharField(max_length=50)
class Song(models.Model):
song_title = models.CharField(max_length=100)
artist = models.ForeignKey(Artist, on_delete=models.CASCADE,related_name = 'song')
album = models.ForeignKey(Album, on_delete=models.CASCADE)
song_length = models.IntegerField()
\ No newline at end of file
from django.test import TestCase
# Create your tests here.
from django.urls import path
from .views import index
urlpatterns = [
path('', index, name='index'),
]
# This might be needed, depending on your Django version
app_name = "homepage"
\ No newline at end of file
from django.http import HttpResponse
def index(request):
return HttpResponse("Welcome to Gab's Music Library!")
\ No newline at end of file
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