Commit b0bc268a authored by Jan Enzo Salvador's avatar Jan Enzo Salvador

Lab 01: Song Library is finished.

parent 9ab218dc
<?xml version="1.0" encoding="UTF-8"?>
<module type="PYTHON_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
<component name="PyDocumentationSettings">
<option name="format" value="PLAIN" />
<option name="myDocStringFormat" value="Plain" />
</component>
</module>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<profile version="1.0">
<option name="myName" value="Project Default" />
<inspection_tool class="PyPep8Inspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="E501" />
<option value="E302" />
<option value="E262" />
<option value="W391" />
<option value="E265" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyPep8NamingInspection" enabled="true" level="WEAK WARNING" enabled_by_default="true">
<option name="ignoredErrors">
<list>
<option value="N802" />
<option value="N803" />
</list>
</option>
</inspection_tool>
<inspection_tool class="PyUnresolvedReferencesInspection" enabled="true" level="WARNING" enabled_by_default="true">
<option name="ignoredIdentifiers">
<list>
<option value="tuple.getRed" />
<option value="tuple.getGreen" />
<option value="tuple.getBlue" />
</list>
</option>
</inspection_tool>
</profile>
</component>
\ No newline at end of file
<component name="InspectionProjectProfileManager">
<settings>
<option name="USE_PROJECT_PROFILE" value="false" />
<version value="1.0" />
</settings>
</component>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectRootManager" version="2" project-jdk-name="Python 3.9" project-jdk-type="Python SDK" />
<component name="PyCharmProfessionalAdvertiser">
<option name="shown" value="true" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/enzosalvador_music.iml" filepath="$PROJECT_DIR$/.idea/enzosalvador_music.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$/.." vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ChangeListManager">
<list default="true" id="7661b32f-0a5f-4299-9512-f3551d91e492" name="Changes" comment="Edited variable name for more meaningful context">
<change afterPath="$PROJECT_DIR$/About/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/About/admin.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/About/apps.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/About/migrations/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/About/models.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/About/tests.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/About/urls.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/admin.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/apps.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/migrations/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/models.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/tests.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Contact/urls.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/admin.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/apps.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/migrations/0001_initial.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/migrations/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/models.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/tests.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/Homepage/urls.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/db.sqlite3" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enzosalvador_music/__init__.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enzosalvador_music/asgi.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enzosalvador_music/settings.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enzosalvador_music/urls.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/enzosalvador_music/wsgi.py" afterDir="false" />
<change afterPath="$PROJECT_DIR$/manage.py" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
<option name="LAST_RESOLUTION" value="IGNORE" />
</component>
<component name="FileTemplateManagerImpl">
<option name="RECENT_TEMPLATES">
<list>
<option value="Python Script" />
</list>
</option>
</component>
<component name="Git.Settings">
<option name="RECENT_GIT_ROOT_PATH" value="$PROJECT_DIR$/.." />
</component>
<component name="ProjectId" id="2LgWIBwTGTq8No1mvP7skwodYqu" />
<component name="ProjectLevelVcsManager" settingsEditedManually="true" />
<component name="ProjectViewState">
<option name="hideEmptyMiddlePackages" value="true" />
<option name="showLibraryContents" value="true" />
</component>
<component name="PropertiesComponent">
<property name="RunOnceActivity.OpenProjectViewOnStart" value="true" />
<property name="RunOnceActivity.ShowReadmeOnStart" value="true" />
<property name="last_opened_file_path" value="$PROJECT_DIR$" />
</component>
<component name="SpellCheckerSettings" RuntimeDictionaries="0" Folders="0" CustomDictionaries="0" DefaultDictionary="application-level" UseSingleDictionary="true" transferred="true" />
<component name="TaskManager">
<task active="true" id="Default" summary="Default task">
<changelist id="7661b32f-0a5f-4299-9512-f3551d91e492" name="Changes" comment="" />
<created>1676293123677</created>
<option name="number" value="Default" />
<option name="presentableId" value="Default" />
<updated>1676293123677</updated>
</task>
<task id="LOCAL-00001" summary="Edited variable name for more meaningful context">
<created>1676295316284</created>
<option name="number" value="00001" />
<option name="presentableId" value="LOCAL-00001" />
<option name="project" value="LOCAL" />
<updated>1676295316284</updated>
</task>
<task id="LOCAL-00002" summary="Edited variable name for more meaningful context">
<created>1676295407251</created>
<option name="number" value="00002" />
<option name="presentableId" value="LOCAL-00002" />
<option name="project" value="LOCAL" />
<updated>1676295407251</updated>
</task>
<task id="LOCAL-00003" summary="Edited variable name for more meaningful context">
<created>1676295559759</created>
<option name="number" value="00003" />
<option name="presentableId" value="LOCAL-00003" />
<option name="project" value="LOCAL" />
<updated>1676295559759</updated>
</task>
<option name="localTasksCounter" value="4" />
<servers />
</component>
<component name="Vcs.Log.Tabs.Properties">
<option name="TAB_STATES">
<map>
<entry key="MAIN">
<value>
<State />
</value>
</entry>
</map>
</option>
</component>
<component name="VcsManagerConfiguration">
<MESSAGE value="Edited variable name for more meaningful context" />
<option name="LAST_COMMIT_MESSAGE" value="Edited variable name for more meaningful context" />
</component>
</project>
\ No newline at end of file
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class AboutConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'About'
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
urlpatterns = [
path('', views.aboutIndex, name="aboutIndex"),
]
\ No newline at end of file
from django.contrib import admin
# Register your models here.
from django.apps import AppConfig
class ContactConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'Contact'
from django.db import models
# Create your models here.
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
urlpatterns = [
path('', views.indexContact, name="index"),
]
\ No newline at end of file
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 4.1.6 on 2023-02-13 13:02
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')),
('album_name', models.CharField(max_length=50)),
('artist', models.CharField(max_length=50)),
('description', models.CharField(max_length=500)),
('release_date', models.DateTimeField(verbose_name='date released')),
],
),
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(default=0)),
],
),
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=50)),
('artist', models.CharField(max_length=50)),
('album', models.CharField(max_length=50)),
('song_length', models.IntegerField()),
],
),
]
from django.db import models
class Artist(models.Model):
artist_name = models.CharField(max_length=50)
monthly_listeners = models.IntegerField(default=0)
class Album(models.Model):
album_name = models.CharField(max_length=50)
artist = models.CharField(max_length=50)
description = models.CharField(max_length=500)
release_date = models.DateTimeField("date released")
class Song(models.Model):
song_title = models.CharField(max_length=50)
artist = models.CharField(max_length=50)
album = models.CharField(max_length=50)
song_length = models.IntegerField()
from django.test import TestCase
# Create your tests here.
from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name="index"),
]
\ No newline at end of file
"""
ASGI config for enzosalvador_music project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'enzosalvador_music.settings')
application = get_asgi_application()
"""
Django settings for enzosalvador_music project.
Generated by 'django-admin startproject' using Django 4.1.6.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/4.1/ref/settings/
"""
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# Quick-start development settings - unsuitable for production
# See https://docs.djangoproject.com/en/4.1/howto/deployment/checklist/
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = 'django-insecure-07_=vx!483adg5f&aj&+a(h7=e21r3optis2@*&2t9f=lrnx#k'
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'Homepage',
'About',
'Contact',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
]
MIDDLEWARE = [
'django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
]
ROOT_URLCONF = 'enzosalvador_music.urls'
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
WSGI_APPLICATION = 'enzosalvador_music.wsgi.application'
# Database
# https://docs.djangoproject.com/en/4.1/ref/settings/#databases
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': BASE_DIR / 'db.sqlite3',
}
}
# Password validation
# https://docs.djangoproject.com/en/4.1/ref/settings/#auth-password-validators
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.CommonPasswordValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.NumericPasswordValidator',
},
]
# Internationalization
# https://docs.djangoproject.com/en/4.1/topics/i18n/
LANGUAGE_CODE = 'en-us'
TIME_ZONE = 'UTC'
USE_I18N = True
USE_TZ = True
# Static files (CSS, JavaScript, Images)
# https://docs.djangoproject.com/en/4.1/howto/static-files/
STATIC_URL = 'static/'
# Default primary key field type
# https://docs.djangoproject.com/en/4.1/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
from django.contrib import admin
from django.urls import include, path
urlpatterns = [
path('homepage', include('Homepage.urls')),
path('about', include('About.urls')),
path('contact', include('Contact.urls')),
path('admin/', admin.site.urls),
]
"""
WSGI config for enzosalvador_music project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/4.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'enzosalvador_music.settings')
application = get_wsgi_application()
#!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'enzosalvador_music.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
execute_from_command_line(sys.argv)
if __name__ == '__main__':
main()
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