diff --git a/altessimo/__init__.py b/altessimo/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/altessimo/asgi.py b/altessimo/asgi.py new file mode 100644 index 0000000..4bc5d97 --- /dev/null +++ b/altessimo/asgi.py @@ -0,0 +1,16 @@ +""" +ASGI config for altessimo 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/3.1/howto/deployment/asgi/ +""" + +import os + +from django.core.asgi import get_asgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'altessimo.settings') + +application = get_asgi_application() diff --git a/altessimo/settings.py b/altessimo/settings.py new file mode 100644 index 0000000..fb94b09 --- /dev/null +++ b/altessimo/settings.py @@ -0,0 +1,128 @@ +""" +Django settings for altessimo project. + +Generated by 'django-admin startproject' using Django 3.1.4. + +For more information on this file, see +https://docs.djangoproject.com/en/3.1/topics/settings/ + +For the full list of settings and their values, see +https://docs.djangoproject.com/en/3.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/3.1/howto/deployment/checklist/ + +# SECURITY WARNING: keep the secret key used in production secret! +SECRET_KEY = '87jexgw!_@w#19b-!_!j_6&0r@v(=c+n783&pt-(un*n4n+@=4' + +# SECURITY WARNING: don't run with debug turned on in production! +DEBUG = True + +ALLOWED_HOSTS = [] + + +# Application definition + +INSTALLED_APPS = [ + 'django.contrib.admin', + 'django.contrib.auth', + 'django.contrib.contenttypes', + 'django.contrib.sessions', + 'django.contrib.messages', + 'django.contrib.staticfiles', + 'categories', + 'artists', + 'songs', + 'home', +] + +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 = 'altessimo.urls' + +TEMPLATES = [ + { + 'BACKEND': 'django.template.backends.django.DjangoTemplates', + 'DIRS': [ BASE_DIR / "templates"], + '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 = 'altessimo.wsgi.application' + + +# Database +# https://docs.djangoproject.com/en/3.1/ref/settings/#databases + +DATABASES = { + 'default': { + 'ENGINE': 'django.db.backends.sqlite3', + 'NAME': BASE_DIR / 'db.sqlite3', + } +} + + +# Password validation +# https://docs.djangoproject.com/en/3.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/3.1/topics/i18n/ + +LANGUAGE_CODE = 'en-us' + +TIME_ZONE = 'UTC' + +USE_I18N = True + +USE_L10N = True + +USE_TZ = True + + +# Static files (CSS, JavaScript, Images) +# https://docs.djangoproject.com/en/3.1/howto/static-files/ + +STATIC_URL = '/static/' + +STATICFILES_DIRS = [ + BASE_DIR / "static", +] diff --git a/altessimo/urls.py b/altessimo/urls.py new file mode 100644 index 0000000..5a9ff86 --- /dev/null +++ b/altessimo/urls.py @@ -0,0 +1,25 @@ +"""altessimo URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.home, name='home') +Class-based views + 1. Add an import: from other_app.views import Home + 2. Add a URL to urlpatterns: path('', Home.as_view(), name='home') +Including another URLconf + 1. Import the include() function: from django.urls import include, path + 2. Add a URL to urlpatterns: path('blog/', include('blog.urls')) +""" +from django.contrib import admin +from django.urls import include, path + +urlpatterns = [ + path('', include('home.urls')), + path('categories/', include('categories.urls')), + path('artists/', include('artists.urls')), + path('songs/', include('songs.urls')), + path('admin/', admin.site.urls), +] diff --git a/altessimo/wsgi.py b/altessimo/wsgi.py new file mode 100644 index 0000000..ad77044 --- /dev/null +++ b/altessimo/wsgi.py @@ -0,0 +1,16 @@ +""" +WSGI config for altessimo 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/3.1/howto/deployment/wsgi/ +""" + +import os + +from django.core.wsgi import get_wsgi_application + +os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'altessimo.settings') + +application = get_wsgi_application() diff --git a/artists/__init__.py b/artists/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/artists/admin.py b/artists/admin.py new file mode 100644 index 0000000..e5a4822 --- /dev/null +++ b/artists/admin.py @@ -0,0 +1,5 @@ +from django.contrib import admin +from . import models +# Register your models here. + +admin.site.register(models.Artist) diff --git a/artists/apps.py b/artists/apps.py new file mode 100644 index 0000000..5a03f28 --- /dev/null +++ b/artists/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class ArtistsConfig(AppConfig): + name = 'artists' diff --git a/artists/migrations/0001_initial.py b/artists/migrations/0001_initial.py new file mode 100644 index 0000000..9fca7b4 --- /dev/null +++ b/artists/migrations/0001_initial.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.4 on 2020-12-15 20:42 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Artist', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('romanized_name', models.CharField(max_length=255)), + ('aliases', models.ManyToManyField(blank=True, related_name='_artist_aliases_+', to='artists.Artist')), + ], + ), + ] diff --git a/artists/migrations/0002_artist_category.py b/artists/migrations/0002_artist_category.py new file mode 100644 index 0000000..d5b5e38 --- /dev/null +++ b/artists/migrations/0002_artist_category.py @@ -0,0 +1,19 @@ +# Generated by Django 3.1.4 on 2020-12-15 20:59 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('categories', '0002_auto_20201215_2054'), + ('artists', '0001_initial'), + ] + + operations = [ + migrations.AddField( + model_name='artist', + name='category', + field=models.ManyToManyField(blank=True, to='categories.Category'), + ), + ] diff --git a/artists/migrations/0003_auto_20201215_2107.py b/artists/migrations/0003_auto_20201215_2107.py new file mode 100644 index 0000000..39ed338 --- /dev/null +++ b/artists/migrations/0003_auto_20201215_2107.py @@ -0,0 +1,23 @@ +# Generated by Django 3.1.4 on 2020-12-15 21:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('artists', '0002_artist_category'), + ] + + operations = [ + migrations.AddField( + model_name='artist', + name='about_composer', + field=models.TextField(blank=True), + ), + migrations.AddField( + model_name='artist', + name='about_music', + field=models.TextField(blank=True), + ), + ] diff --git a/artists/migrations/__init__.py b/artists/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/artists/models.py b/artists/models.py new file mode 100644 index 0000000..4683227 --- /dev/null +++ b/artists/models.py @@ -0,0 +1,15 @@ +from django.db import models +from django.apps import apps + +# Create your models here. + +class Artist(models.Model): + name = models.CharField(max_length=255) + romanized_name = models.CharField(max_length=255) + aliases = models.ManyToManyField("self",blank=True) + category = models.ManyToManyField("categories.Category",blank=True) + about_composer = models.TextField(blank=True) + about_music = models.TextField(blank=True) + + def __str__(self): + return self.romanized_name diff --git a/artists/tests.py b/artists/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/artists/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/artists/urls.py b/artists/urls.py new file mode 100644 index 0000000..f39e8be --- /dev/null +++ b/artists/urls.py @@ -0,0 +1,6 @@ +from django.urls import path + +from . import views + +urlpatterns = [ +] diff --git a/artists/views.py b/artists/views.py new file mode 100644 index 0000000..91ea44a --- /dev/null +++ b/artists/views.py @@ -0,0 +1,3 @@ +from django.shortcuts import render + +# Create your views here. diff --git a/categories/__init__.py b/categories/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/categories/admin.py b/categories/admin.py new file mode 100644 index 0000000..090f259 --- /dev/null +++ b/categories/admin.py @@ -0,0 +1,6 @@ +from django.contrib import admin + +from . import models +# Register your models here. + +admin.site.register(models.Category) diff --git a/categories/apps.py b/categories/apps.py new file mode 100644 index 0000000..0ab5f86 --- /dev/null +++ b/categories/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class CategoriesConfig(AppConfig): + name = 'categories' diff --git a/categories/migrations/0001_initial.py b/categories/migrations/0001_initial.py new file mode 100644 index 0000000..7d95233 --- /dev/null +++ b/categories/migrations/0001_initial.py @@ -0,0 +1,22 @@ +# Generated by Django 3.1.4 on 2020-12-15 20:49 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + initial = True + + dependencies = [ + ] + + operations = [ + migrations.CreateModel( + name='Category', + fields=[ + ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), + ('name', models.CharField(max_length=255)), + ('description', models.CharField(max_length=255)), + ], + ), + ] diff --git a/categories/migrations/0002_auto_20201215_2054.py b/categories/migrations/0002_auto_20201215_2054.py new file mode 100644 index 0000000..396dc31 --- /dev/null +++ b/categories/migrations/0002_auto_20201215_2054.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.4 on 2020-12-15 20:54 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('categories', '0001_initial'), + ] + + operations = [ + migrations.AlterField( + model_name='category', + name='description', + field=models.TextField(), + ), + ] diff --git a/categories/migrations/0003_auto_20201215_2107.py b/categories/migrations/0003_auto_20201215_2107.py new file mode 100644 index 0000000..673a0a4 --- /dev/null +++ b/categories/migrations/0003_auto_20201215_2107.py @@ -0,0 +1,18 @@ +# Generated by Django 3.1.4 on 2020-12-15 21:07 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('categories', '0002_auto_20201215_2054'), + ] + + operations = [ + migrations.AlterField( + model_name='category', + name='description', + field=models.TextField(blank=True), + ), + ] diff --git a/categories/migrations/__init__.py b/categories/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/categories/models.py b/categories/models.py new file mode 100644 index 0000000..4ebb0f1 --- /dev/null +++ b/categories/models.py @@ -0,0 +1,14 @@ +from django.db import models + +# Create your models here. + +class Category(models.Model): + name = models.CharField(max_length=255) + description = models.TextField(blank=True) + + class Meta: + verbose_name_plural = "Categories" + + def __str__(self): + return self.name + diff --git a/categories/tests.py b/categories/tests.py new file mode 100644 index 0000000..7ce503c --- /dev/null +++ b/categories/tests.py @@ -0,0 +1,3 @@ +from django.test import TestCase + +# Create your tests here. diff --git a/categories/urls.py b/categories/urls.py new file mode 100644 index 0000000..f39e8be --- /dev/null +++ b/categories/urls.py @@ -0,0 +1,6 @@ +from django.urls import path + +from . import views + +urlpatterns = [ +] diff --git a/categories/views.py b/categories/views.py new file mode 100644 index 0000000..521df64 --- /dev/null +++ b/categories/views.py @@ -0,0 +1,6 @@ +from django.shortcuts import render +from django.http import HttpResponse + +# Create your views here. +def index(request): + return HttpResponse("Yuika!") diff --git a/home/__init__.py b/home/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/home/admin.py b/home/admin.py new file mode 100644 index 0000000..8c38f3f --- /dev/null +++ b/home/admin.py @@ -0,0 +1,3 @@ +from django.contrib import admin + +# Register your models here. diff --git a/home/apps.py b/home/apps.py new file mode 100644 index 0000000..90dc713 --- /dev/null +++ b/home/apps.py @@ -0,0 +1,5 @@ +from django.apps import AppConfig + + +class HomeConfig(AppConfig): + name = 'home' diff --git a/home/migrations/__init__.py b/home/migrations/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/home/models.py b/home/models.py new file mode 100644 index 0000000..71a8362 --- /dev/null +++ b/home/models.py @@ -0,0 +1,3 @@ +from django.db import models + +# Create your models here. diff --git a/home/templates/index.html b/home/templates/index.html new file mode 100644 index 0000000..dc6e195 --- /dev/null +++ b/home/templates/index.html @@ -0,0 +1,5 @@ +{% extends 'layouts/base.html' %} + +{% block content %} +