Commit 8abba79d authored by Albert's avatar Albert

finished setting up the admin panel

parent 13936a11
# Generated by Django 4.1.6 on 2023-02-13 15:36
from django.db import migrations, models
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",
),
),
("artist", models.CharField(max_length=100, unique=True)),
("album_name", models.CharField(max_length=100, unique=True)),
("description", models.TextField()),
("release_date", models.DateField()),
],
),
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=100, unique=True)),
("monthly_listeners", models.IntegerField()),
],
),
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, unique=True)),
("artist", models.CharField(max_length=50)),
("description", models.TextField()),
("song_length", models.IntegerField()),
],
),
]
...@@ -3,24 +3,24 @@ from django.db import models ...@@ -3,24 +3,24 @@ from django.db import models
# Create your models here. # Create your models here.
class Artist(models.Model): class Artist(models.Model):
artist_name = models.CharField(max_length=50, unique=True) artist_name = models.CharField(default="",max_length=50)
monthly_listeners = models.PositiveIntegerField() monthly_listeners = models.PositiveIntegerField(default=0)
birth_name = models.CharField(max_length=100, unique=True) birth_name = models.CharField(default="", max_length=100)
bio = models.TextField(max_length = 700) bio = models.TextField(default="", max_length = 700)
class Album(models.Model): class Album(models.Model):
artist = models.CharField(max_length=50,unique=True) artist = models.CharField(default="", max_length=50)
album_name = models.CharField(max_length=50, unique=True) album_name = models.CharField(default="", max_length=50)
description = models.TextField() description = models.TextField(default="")
release_date = models.DateField() release_date = models.DateField()
label = models.CharField(max_length=50) label = models.CharField(default="", max_length=50)
song_count = models.PositiveIntegerField() song_count = models.PositiveIntegerField(default=0)
class Song(models.Model): class Song(models.Model):
song_title = models.CharField(max_length=50, unique=True) song_title = models.CharField(default="", max_length=50)
artist = models.CharField(max_length=50) artist = models.CharField(default="", max_length=50)
description = models.TextField()
song_length = models.PositiveIntegerField()
music_video = models.BooleanField(default=False) music_video = models.BooleanField(default=False)
lyrics = models.TextField() song_length = models.PositiveIntegerField(default=0)
\ No newline at end of file lyrics = models.TextField(default="")
description = models.TextField(default="")
\ No newline at end of file
...@@ -2,10 +2,6 @@ from django.shortcuts import render ...@@ -2,10 +2,6 @@ from django.shortcuts import render
# Create your views here. # Create your views here.
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse from django.http import HttpResponse
def index(request): def index(request):
......
...@@ -17,7 +17,6 @@ from django.contrib import admin ...@@ -17,7 +17,6 @@ from django.contrib import admin
from django.urls import path, include from django.urls import path, include
urlpatterns = [ urlpatterns = [
path('', include('homepage.urls', namespace='homepage')),
path('homepage/', include('homepage.urls', namespace="homepage")), path('homepage/', include('homepage.urls', namespace="homepage")),
path('about/', include('about.urls', namespace="about")), path('about/', include('about.urls', namespace="about")),
path('contact/', include('contact.urls', namespace="contact")), path('contact/', include('contact.urls', namespace="contact")),
......
No preview for this file type
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