diff --git a/Makefile b/Makefile index d151cfd..bb89001 100644 --- a/Makefile +++ b/Makefile @@ -2,13 +2,13 @@ PYTHON=env/bin/python DROPZONE=5.7.0 test: - poetry run coverage run --include "app/*" --omit "*/migrations/*" app/manage.py test app + poetry run coverage run --include "polyphonic/*" --omit "*/migrations/*" polyphonic/manage.py test polyphonic poetry run coverage html poetry run coverage report check: - poetry run ruff check app - poetry run ruff format --check app || true + poetry run ruff check polyphonic + poetry run ruff format --check polyphonic pre-commit: check test diff --git a/app/interface/__init__.py b/polyphonic/__init__.py similarity index 100% rename from app/interface/__init__.py rename to polyphonic/__init__.py diff --git a/app/interface/migrations/__init__.py b/polyphonic/config/__init__.py similarity index 100% rename from app/interface/migrations/__init__.py rename to polyphonic/config/__init__.py diff --git a/app/polyphonic/asgi.py b/polyphonic/config/asgi.py similarity index 82% rename from app/polyphonic/asgi.py rename to polyphonic/config/asgi.py index c0c4aa2..be9713e 100644 --- a/app/polyphonic/asgi.py +++ b/polyphonic/config/asgi.py @@ -11,6 +11,6 @@ import os from django.core.asgi import get_asgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'polyphonic.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.settings") application = get_asgi_application() diff --git a/app/library/__init__.py b/polyphonic/config/settings/__init__.py similarity index 100% rename from app/library/__init__.py rename to polyphonic/config/settings/__init__.py diff --git a/app/polyphonic/settings/base.py b/polyphonic/config/settings/base.py similarity index 92% rename from app/polyphonic/settings/base.py rename to polyphonic/config/settings/base.py index dfd13bd..48c4050 100644 --- a/app/polyphonic/settings/base.py +++ b/polyphonic/config/settings/base.py @@ -29,11 +29,11 @@ SECRET_KEY = os.environ.get("SECRET_KEY") # SECURITY WARNING: don't run with debug turned on in production! DEBUG = False -ALLOWED_HOSTS = ["localhost"] +ALLOWED_HOSTS = ["localhost", "127.0.0.1"] # Application definition -POLYPHONIC_MODULES = ["library"] +POLYPHONIC_MODULES = ["polyphonic.library"] INSTALLED_APPS = [ "django.contrib.admin", @@ -47,7 +47,7 @@ INSTALLED_APPS = [ "crispy_forms", "crispy_bulma", "byostorage", - "interface", + "polyphonic.interface", ] INSTALLED_APPS += POLYPHONIC_MODULES @@ -65,7 +65,7 @@ MIDDLEWARE = [ "django.middleware.clickjacking.XFrameOptionsMiddleware", ] -ROOT_URLCONF = "polyphonic.urls" +ROOT_URLCONF = "polyphonic.config.urls" TEMPLATES = [ { @@ -83,7 +83,7 @@ TEMPLATES = [ }, ] -WSGI_APPLICATION = "polyphonic.wsgi.application" +WSGI_APPLICATION = "polyphonic.config.wsgi.application" # Database @@ -139,4 +139,4 @@ STATIC_ROOT = "static" CACHED_STORAGE_REMOTE = "byostorage.user.BYOStorage" CACHED_STORAGE_DIR = os.path.join(WORK_DIR, "cache") WHOOSH_INDEX = os.path.join(WORK_DIR, "index") -STORAGE_CLASSES = ["library.gdrive.storage.GDriveLinkStorage"] +STORAGE_CLASSES = ["polyphonic.library.gdrive.storage.GDriveLinkStorage"] diff --git a/app/polyphonic/settings/dev.py b/polyphonic/config/settings/dev.py similarity index 100% rename from app/polyphonic/settings/dev.py rename to polyphonic/config/settings/dev.py diff --git a/app/polyphonic/settings/docker.py b/polyphonic/config/settings/docker.py similarity index 100% rename from app/polyphonic/settings/docker.py rename to polyphonic/config/settings/docker.py diff --git a/app/polyphonic/urls.py b/polyphonic/config/urls.py similarity index 90% rename from app/polyphonic/urls.py rename to polyphonic/config/urls.py index 09f1881..9c99fa7 100644 --- a/app/polyphonic/urls.py +++ b/polyphonic/config/urls.py @@ -19,9 +19,9 @@ from django.urls import path, include urlpatterns = [ path("admin/", admin.site.urls), - path("", include("interface.urls")), + path("", include("polyphonic.interface.urls")), # path('', include('submissions.urls')), - path("", include("library.urls")), + path("", include("polyphonic.library.urls")), ] try: diff --git a/app/polyphonic/wsgi.py b/polyphonic/config/wsgi.py similarity index 79% rename from app/polyphonic/wsgi.py rename to polyphonic/config/wsgi.py index afba7c6..ad344fc 100644 --- a/app/polyphonic/wsgi.py +++ b/polyphonic/config/wsgi.py @@ -11,6 +11,6 @@ import os from django.core.wsgi import get_wsgi_application -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'polyphonic.settings') +os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.config.settings.base") application = get_wsgi_application() diff --git a/app/dev-requirements.txt b/polyphonic/dev-requirements.txt similarity index 100% rename from app/dev-requirements.txt rename to polyphonic/dev-requirements.txt diff --git a/app/library/management/__init__.py b/polyphonic/interface/__init__.py similarity index 100% rename from app/library/management/__init__.py rename to polyphonic/interface/__init__.py diff --git a/app/interface/admin.py b/polyphonic/interface/admin.py similarity index 100% rename from app/interface/admin.py rename to polyphonic/interface/admin.py diff --git a/app/interface/apps.py b/polyphonic/interface/apps.py similarity index 67% rename from app/interface/apps.py rename to polyphonic/interface/apps.py index 0c7d2c4..208c11e 100644 --- a/app/interface/apps.py +++ b/polyphonic/interface/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class InterfaceConfig(AppConfig): - name = "interface" + name = "polyphonic.interface" diff --git a/app/interface/fields.py b/polyphonic/interface/fields.py similarity index 100% rename from app/interface/fields.py rename to polyphonic/interface/fields.py diff --git a/app/interface/forms.py b/polyphonic/interface/forms.py similarity index 100% rename from app/interface/forms.py rename to polyphonic/interface/forms.py diff --git a/app/interface/migrations/0001_initial.py b/polyphonic/interface/migrations/0001_initial.py similarity index 94% rename from app/interface/migrations/0001_initial.py rename to polyphonic/interface/migrations/0001_initial.py index 58ec38e..c733c18 100644 --- a/app/interface/migrations/0001_initial.py +++ b/polyphonic/interface/migrations/0001_initial.py @@ -4,7 +4,7 @@ import byostorage.user from django.conf import settings from django.db import migrations, models import django.db.models.deletion -import interface.models +import polyphonic.interface.models class Migration(migrations.Migration): @@ -23,7 +23,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(help_text='Display name', max_length=100)), ('slug', models.SlugField(editable=False, help_text='Short name for the ensemble - used for folders', max_length=100, unique=True)), - ('code', models.CharField(default=interface.models.generate_code, help_text='Ensemble registration code', max_length=9)), + ('code', models.CharField(default=polyphonic.interface.models.generate_code, help_text='Ensemble registration code', max_length=9)), ('passphrase', models.CharField(help_text='Used to register ensembles', max_length=100)), ('details', models.TextField(blank=True, help_text='Description of the ensemble (markdown)')), ('admins', models.ManyToManyField(related_name='ensembles', to=settings.AUTH_USER_MODEL)), @@ -60,7 +60,7 @@ class Migration(migrations.Migration): ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('name', models.CharField(max_length=100)), ('description', models.TextField(blank=True)), - ('file', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=interface.models.resource_key)), + ('file', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=polyphonic.interface.models.resource_key)), ('media_type', models.CharField(choices=[('audio', 'Audio'), ('video', 'Video'), ('general', 'General')], default='*', max_length=10)), ('visible', models.BooleanField(default=True)), ('project', models.ForeignKey(on_delete=django.db.models.deletion.CASCADE, related_name='resources', to='interface.project')), diff --git a/app/interface/migrations/0002_auto_20230202_0804.py b/polyphonic/interface/migrations/0002_auto_20230202_0804.py similarity index 100% rename from app/interface/migrations/0002_auto_20230202_0804.py rename to polyphonic/interface/migrations/0002_auto_20230202_0804.py diff --git a/app/interface/migrations/0003_auto_20230209_0910.py b/polyphonic/interface/migrations/0003_auto_20230209_0910.py similarity index 100% rename from app/interface/migrations/0003_auto_20230209_0910.py rename to polyphonic/interface/migrations/0003_auto_20230209_0910.py diff --git a/app/interface/migrations/0004_auto_20230210_0938.py b/polyphonic/interface/migrations/0004_auto_20230210_0938.py similarity index 100% rename from app/interface/migrations/0004_auto_20230210_0938.py rename to polyphonic/interface/migrations/0004_auto_20230210_0938.py diff --git a/app/library/management/commands/__init__.py b/polyphonic/interface/migrations/__init__.py similarity index 100% rename from app/library/management/commands/__init__.py rename to polyphonic/interface/migrations/__init__.py diff --git a/app/interface/models.py b/polyphonic/interface/models.py similarity index 100% rename from app/interface/models.py rename to polyphonic/interface/models.py diff --git a/app/interface/static/fonts/Martinhand3.ttf b/polyphonic/interface/static/fonts/Martinhand3.ttf similarity index 100% rename from app/interface/static/fonts/Martinhand3.ttf rename to polyphonic/interface/static/fonts/Martinhand3.ttf diff --git a/app/interface/static/interface/background.png b/polyphonic/interface/static/interface/background.png similarity index 100% rename from app/interface/static/interface/background.png rename to polyphonic/interface/static/interface/background.png diff --git a/app/interface/static/interface/css/polyphonic.css b/polyphonic/interface/static/interface/css/polyphonic.css similarity index 100% rename from app/interface/static/interface/css/polyphonic.css rename to polyphonic/interface/static/interface/css/polyphonic.css diff --git a/app/interface/static/interface/icon.png b/polyphonic/interface/static/interface/icon.png similarity index 100% rename from app/interface/static/interface/icon.png rename to polyphonic/interface/static/interface/icon.png diff --git a/app/interface/static/interface/js/interface.js b/polyphonic/interface/static/interface/js/interface.js similarity index 100% rename from app/interface/static/interface/js/interface.js rename to polyphonic/interface/static/interface/js/interface.js diff --git a/app/interface/templates/403.html b/polyphonic/interface/templates/403.html similarity index 100% rename from app/interface/templates/403.html rename to polyphonic/interface/templates/403.html diff --git a/app/interface/templates/404.html b/polyphonic/interface/templates/404.html similarity index 100% rename from app/interface/templates/404.html rename to polyphonic/interface/templates/404.html diff --git a/app/interface/templates/base.html b/polyphonic/interface/templates/base.html similarity index 100% rename from app/interface/templates/base.html rename to polyphonic/interface/templates/base.html diff --git a/app/interface/templates/bulma/file_upload.html b/polyphonic/interface/templates/bulma/file_upload.html similarity index 100% rename from app/interface/templates/bulma/file_upload.html rename to polyphonic/interface/templates/bulma/file_upload.html diff --git a/app/interface/templates/interface/default_form.html b/polyphonic/interface/templates/interface/default_form.html similarity index 100% rename from app/interface/templates/interface/default_form.html rename to polyphonic/interface/templates/interface/default_form.html diff --git a/app/interface/templates/interface/ensemble_detail.html b/polyphonic/interface/templates/interface/ensemble_detail.html similarity index 100% rename from app/interface/templates/interface/ensemble_detail.html rename to polyphonic/interface/templates/interface/ensemble_detail.html diff --git a/app/interface/templates/interface/ensemble_list.html b/polyphonic/interface/templates/interface/ensemble_list.html similarity index 100% rename from app/interface/templates/interface/ensemble_list.html rename to polyphonic/interface/templates/interface/ensemble_list.html diff --git a/app/interface/templates/interface/manage.html b/polyphonic/interface/templates/interface/manage.html similarity index 100% rename from app/interface/templates/interface/manage.html rename to polyphonic/interface/templates/interface/manage.html diff --git a/app/interface/templates/interface/project_base.html b/polyphonic/interface/templates/interface/project_base.html similarity index 100% rename from app/interface/templates/interface/project_base.html rename to polyphonic/interface/templates/interface/project_base.html diff --git a/app/interface/templates/interface/project_detail.html b/polyphonic/interface/templates/interface/project_detail.html similarity index 100% rename from app/interface/templates/interface/project_detail.html rename to polyphonic/interface/templates/interface/project_detail.html diff --git a/app/interface/templates/interface/project_items.html b/polyphonic/interface/templates/interface/project_items.html similarity index 100% rename from app/interface/templates/interface/project_items.html rename to polyphonic/interface/templates/interface/project_items.html diff --git a/app/interface/templates/interface/project_list.html b/polyphonic/interface/templates/interface/project_list.html similarity index 100% rename from app/interface/templates/interface/project_list.html rename to polyphonic/interface/templates/interface/project_list.html diff --git a/app/interface/templates/interface/register.html b/polyphonic/interface/templates/interface/register.html similarity index 100% rename from app/interface/templates/interface/register.html rename to polyphonic/interface/templates/interface/register.html diff --git a/app/interface/templates/interface/resource_list.html b/polyphonic/interface/templates/interface/resource_list.html similarity index 100% rename from app/interface/templates/interface/resource_list.html rename to polyphonic/interface/templates/interface/resource_list.html diff --git a/app/interface/templates/interface/s3_upload.html b/polyphonic/interface/templates/interface/s3_upload.html similarity index 100% rename from app/interface/templates/interface/s3_upload.html rename to polyphonic/interface/templates/interface/s3_upload.html diff --git a/app/interface/templates/interface/wiki.html b/polyphonic/interface/templates/interface/wiki.html similarity index 100% rename from app/interface/templates/interface/wiki.html rename to polyphonic/interface/templates/interface/wiki.html diff --git a/app/interface/templates/interface/wikipage_form.html b/polyphonic/interface/templates/interface/wikipage_form.html similarity index 100% rename from app/interface/templates/interface/wikipage_form.html rename to polyphonic/interface/templates/interface/wikipage_form.html diff --git a/app/interface/templates/registration/login.html b/polyphonic/interface/templates/registration/login.html similarity index 100% rename from app/interface/templates/registration/login.html rename to polyphonic/interface/templates/registration/login.html diff --git a/app/interface/templatetags/path_filters.py b/polyphonic/interface/templatetags/path_filters.py similarity index 100% rename from app/interface/templatetags/path_filters.py rename to polyphonic/interface/templatetags/path_filters.py diff --git a/app/interface/templatetags/polyphonic.py b/polyphonic/interface/templatetags/polyphonic.py similarity index 100% rename from app/interface/templatetags/polyphonic.py rename to polyphonic/interface/templatetags/polyphonic.py diff --git a/app/interface/templatetags/url_tools.py b/polyphonic/interface/templatetags/url_tools.py similarity index 100% rename from app/interface/templatetags/url_tools.py rename to polyphonic/interface/templatetags/url_tools.py diff --git a/app/interface/tests/__init__.py b/polyphonic/interface/tests/__init__.py similarity index 98% rename from app/interface/tests/__init__.py rename to polyphonic/interface/tests/__init__.py index 6f8d571..dadfca7 100644 --- a/app/interface/tests/__init__.py +++ b/polyphonic/interface/tests/__init__.py @@ -1,5 +1,5 @@ from django.test import TestCase -from interface import models +from polyphonic.interface import models from django.contrib.auth.models import User from django.utils import timezone from datetime import timedelta diff --git a/app/interface/tests/test_access.py b/polyphonic/interface/tests/test_access.py similarity index 99% rename from app/interface/tests/test_access.py rename to polyphonic/interface/tests/test_access.py index 96c4861..23c0d9c 100644 --- a/app/interface/tests/test_access.py +++ b/polyphonic/interface/tests/test_access.py @@ -1,5 +1,4 @@ - -from interface import models +from polyphonic.interface import models from . import AccessTestCase diff --git a/app/interface/tests/test_integration.py b/polyphonic/interface/tests/test_integration.py similarity index 100% rename from app/interface/tests/test_integration.py rename to polyphonic/interface/tests/test_integration.py diff --git a/app/interface/urls.py b/polyphonic/interface/urls.py similarity index 100% rename from app/interface/urls.py rename to polyphonic/interface/urls.py diff --git a/app/interface/utils.py b/polyphonic/interface/utils.py similarity index 100% rename from app/interface/utils.py rename to polyphonic/interface/utils.py diff --git a/app/interface/views.py b/polyphonic/interface/views.py similarity index 99% rename from app/interface/views.py rename to polyphonic/interface/views.py index 2cf0180..d916dc3 100644 --- a/app/interface/views.py +++ b/polyphonic/interface/views.py @@ -15,7 +15,7 @@ from django.contrib.auth import logout from markdown2 import markdown from . import models, forms -from interface.utils import check_signed_url +from .utils import check_signed_url import logging diff --git a/app/library/README.md b/polyphonic/library/README.md similarity index 100% rename from app/library/README.md rename to polyphonic/library/README.md diff --git a/app/library/migrations/__init__.py b/polyphonic/library/__init__.py similarity index 100% rename from app/library/migrations/__init__.py rename to polyphonic/library/__init__.py diff --git a/app/library/admin.py b/polyphonic/library/admin.py similarity index 100% rename from app/library/admin.py rename to polyphonic/library/admin.py diff --git a/app/library/apps.py b/polyphonic/library/apps.py similarity index 68% rename from app/library/apps.py rename to polyphonic/library/apps.py index 5e69348..43efc94 100644 --- a/app/library/apps.py +++ b/polyphonic/library/apps.py @@ -2,4 +2,4 @@ from django.apps import AppConfig class LibraryConfig(AppConfig): - name = "library" + name = "polyphonic.library" diff --git a/app/library/fixtures/default_orchestrations.json b/polyphonic/library/fixtures/default_orchestrations.json similarity index 100% rename from app/library/fixtures/default_orchestrations.json rename to polyphonic/library/fixtures/default_orchestrations.json diff --git a/app/library/forms.py b/polyphonic/library/forms.py similarity index 93% rename from app/library/forms.py rename to polyphonic/library/forms.py index 58eae95..7661617 100644 --- a/app/library/forms.py +++ b/polyphonic/library/forms.py @@ -1,7 +1,7 @@ from django import forms from .models import Work -from interface.models import Project -from interface.forms import BaseForm +from polyphonic.interface.models import Project +from polyphonic.interface.forms import BaseForm class WorkCreateForm(forms.ModelForm, BaseForm): diff --git a/app/library/gdrive/__init__.py b/polyphonic/library/gdrive/__init__.py similarity index 96% rename from app/library/gdrive/__init__.py rename to polyphonic/library/gdrive/__init__.py index 4ce032e..30c10c1 100644 --- a/app/library/gdrive/__init__.py +++ b/polyphonic/library/gdrive/__init__.py @@ -1,4 +1,4 @@ -from library.models import Collection, Work, WorkMeta, Document +from polyphonic.library.models import Collection, Work, WorkMeta, Document import logging diff --git a/app/library/gdrive/storage.py b/polyphonic/library/gdrive/storage.py similarity index 100% rename from app/library/gdrive/storage.py rename to polyphonic/library/gdrive/storage.py diff --git a/app/library/gdrive/views.py b/polyphonic/library/gdrive/views.py similarity index 92% rename from app/library/gdrive/views.py rename to polyphonic/library/gdrive/views.py index c465638..8192422 100644 --- a/app/library/gdrive/views.py +++ b/polyphonic/library/gdrive/views.py @@ -1,9 +1,9 @@ from django.shortcuts import resolve_url, redirect from django.views.generic import FormView from django.views.generic.detail import SingleObjectMixin -from library.views import CollectionMixin -from library.models import Work, Document -from library import forms +from polyphonic.library.views import CollectionMixin +from polyphonic.library.models import Work, Document +from polyphonic.library import forms class WorkGDriveView(CollectionMixin, SingleObjectMixin, FormView): diff --git a/app/library/indexer/__init__.py b/polyphonic/library/indexer/__init__.py similarity index 95% rename from app/library/indexer/__init__.py rename to polyphonic/library/indexer/__init__.py index 4b09bb9..66863db 100644 --- a/app/library/indexer/__init__.py +++ b/polyphonic/library/indexer/__init__.py @@ -3,9 +3,9 @@ from django.conf import settings from django.utils.module_loading import import_module from django.db.models import QuerySet -from library.models import Work, Collection +from polyphonic.library.models import Work, Collection -instance = getattr(settings, "INDEXER", "library.indexer.whoosh") +instance = getattr(settings, "INDEXER", "polyphonic.library.indexer.whoosh") class Indexer(Protocol): diff --git a/app/library/indexer/whoosh.py b/polyphonic/library/indexer/whoosh.py similarity index 100% rename from app/library/indexer/whoosh.py rename to polyphonic/library/indexer/whoosh.py diff --git a/app/library/tests/__init__.py b/polyphonic/library/management/__init__.py similarity index 100% rename from app/library/tests/__init__.py rename to polyphonic/library/management/__init__.py diff --git a/app/polyphonic/__init__.py b/polyphonic/library/management/commands/__init__.py similarity index 100% rename from app/polyphonic/__init__.py rename to polyphonic/library/management/commands/__init__.py diff --git a/app/library/management/commands/import_works.py b/polyphonic/library/management/commands/import_works.py similarity index 100% rename from app/library/management/commands/import_works.py rename to polyphonic/library/management/commands/import_works.py diff --git a/app/library/management/commands/index.py b/polyphonic/library/management/commands/index.py similarity index 92% rename from app/library/management/commands/index.py rename to polyphonic/library/management/commands/index.py index 4657152..f88ccda 100644 --- a/app/library/management/commands/index.py +++ b/polyphonic/library/management/commands/index.py @@ -1,7 +1,7 @@ from django.core.management.base import BaseCommand -from library import models -from library.indexer import model_search, index_works, indexer +from polyphonic.library import models +from polyphonic.library.indexer import model_search, index_works, indexer FORMATTER = "{w.name:50s} {w.edition:15s} {w.collection.name:15s}" diff --git a/app/library/management/commands/sync.py b/polyphonic/library/management/commands/sync.py similarity index 85% rename from app/library/management/commands/sync.py rename to polyphonic/library/management/commands/sync.py index 348311d..cad6d84 100644 --- a/app/library/management/commands/sync.py +++ b/polyphonic/library/management/commands/sync.py @@ -1,6 +1,6 @@ from django.core.management.base import BaseCommand, CommandError -from library.models import Work, Collection -from library.gdrive import sync_work, sync_collection +from polyphonic.library.models import Work, Collection +from polyphonic.library.gdrive import sync_work, sync_collection class Command(BaseCommand): diff --git a/app/library/migrations/0001_initial.py b/polyphonic/library/migrations/0001_initial.py similarity index 98% rename from app/library/migrations/0001_initial.py rename to polyphonic/library/migrations/0001_initial.py index 3941936..4b49ea8 100644 --- a/app/library/migrations/0001_initial.py +++ b/polyphonic/library/migrations/0001_initial.py @@ -4,7 +4,7 @@ import byostorage.user from django.conf import settings from django.db import migrations, models import django.db.models.deletion -import library.models +import polyphonic.library.models class Migration(migrations.Migration): @@ -35,7 +35,7 @@ class Migration(migrations.Migration): fields=[ ('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('doctype', models.PositiveSmallIntegerField(choices=[(1, 'PDF'), (2, 'Audio'), (3, 'Video'), (4, 'Source')], default=1)), - ('upload', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=library.models.doc_upload_filename)), + ('upload', models.FileField(storage=byostorage.user.BYOStorage(), upload_to=polyphonic.library.models.doc_upload_filename)), ('created', models.DateTimeField(auto_now_add=True)), ('version', models.CharField(blank=True, max_length=30)), ], diff --git a/app/library/migrations/0002_auto_20221201_0934.py b/polyphonic/library/migrations/0002_auto_20221201_0934.py similarity index 100% rename from app/library/migrations/0002_auto_20221201_0934.py rename to polyphonic/library/migrations/0002_auto_20221201_0934.py diff --git a/app/library/migrations/0003_auto_20221201_1540.py b/polyphonic/library/migrations/0003_auto_20221201_1540.py similarity index 100% rename from app/library/migrations/0003_auto_20221201_1540.py rename to polyphonic/library/migrations/0003_auto_20221201_1540.py diff --git a/app/library/migrations/0004_auto_20230101_1535.py b/polyphonic/library/migrations/0004_auto_20230101_1535.py similarity index 89% rename from app/library/migrations/0004_auto_20230101_1535.py rename to polyphonic/library/migrations/0004_auto_20230101_1535.py index 463717e..59253ed 100644 --- a/app/library/migrations/0004_auto_20230101_1535.py +++ b/polyphonic/library/migrations/0004_auto_20230101_1535.py @@ -3,7 +3,7 @@ import byostorage.cached import byostorage.user from django.db import migrations, models -import library.models +import polyphonic.library.models class Migration(migrations.Migration): @@ -26,7 +26,7 @@ class Migration(migrations.Migration): migrations.AlterField( model_name='document', name='upload', - field=models.FileField(storage=byostorage.cached.CachedStorage(byostorage.user.BYOStorage()), upload_to=library.models.doc_upload_filename), + field=models.FileField(storage=byostorage.cached.CachedStorage(byostorage.user.BYOStorage()), upload_to=polyphonic.library.models.doc_upload_filename), ), migrations.AlterField( model_name='work', diff --git a/app/library/migrations/0005_auto_20230101_1547.py b/polyphonic/library/migrations/0005_auto_20230101_1547.py similarity index 100% rename from app/library/migrations/0005_auto_20230101_1547.py rename to polyphonic/library/migrations/0005_auto_20230101_1547.py diff --git a/app/library/migrations/0006_auto_20230202_0804.py b/polyphonic/library/migrations/0006_auto_20230202_0804.py similarity index 100% rename from app/library/migrations/0006_auto_20230202_0804.py rename to polyphonic/library/migrations/0006_auto_20230202_0804.py diff --git a/app/library/migrations/0007_orchestration.py b/polyphonic/library/migrations/0007_orchestration.py similarity index 100% rename from app/library/migrations/0007_orchestration.py rename to polyphonic/library/migrations/0007_orchestration.py diff --git a/app/library/migrations/0010_work_orchestration.py b/polyphonic/library/migrations/0010_work_orchestration.py similarity index 100% rename from app/library/migrations/0010_work_orchestration.py rename to polyphonic/library/migrations/0010_work_orchestration.py diff --git a/app/library/migrations/0011_section_page.py b/polyphonic/library/migrations/0011_section_page.py similarity index 100% rename from app/library/migrations/0011_section_page.py rename to polyphonic/library/migrations/0011_section_page.py diff --git a/app/library/migrations/0012_auto_20230220_1013.py b/polyphonic/library/migrations/0012_auto_20230220_1013.py similarity index 100% rename from app/library/migrations/0012_auto_20230220_1013.py rename to polyphonic/library/migrations/0012_auto_20230220_1013.py diff --git a/app/library/migrations/0013_auto_20230223_1322.py b/polyphonic/library/migrations/0013_auto_20230223_1322.py similarity index 100% rename from app/library/migrations/0013_auto_20230223_1322.py rename to polyphonic/library/migrations/0013_auto_20230223_1322.py diff --git a/app/library/migrations/0014_auto_20230223_1422.py b/polyphonic/library/migrations/0014_auto_20230223_1422.py similarity index 100% rename from app/library/migrations/0014_auto_20230223_1422.py rename to polyphonic/library/migrations/0014_auto_20230223_1422.py diff --git a/app/library/migrations/0015_collection_settings_alter_document_doctype.py b/polyphonic/library/migrations/0015_collection_settings_alter_document_doctype.py similarity index 100% rename from app/library/migrations/0015_collection_settings_alter_document_doctype.py rename to polyphonic/library/migrations/0015_collection_settings_alter_document_doctype.py diff --git a/app/polyphonic/settings/__init__.py b/polyphonic/library/migrations/__init__.py similarity index 100% rename from app/polyphonic/settings/__init__.py rename to polyphonic/library/migrations/__init__.py diff --git a/app/library/models.py b/polyphonic/library/models.py similarity index 99% rename from app/library/models.py rename to polyphonic/library/models.py index d1799a6..ff5dd9c 100644 --- a/app/library/models.py +++ b/polyphonic/library/models.py @@ -11,8 +11,8 @@ import os.path from byostorage.user import BYOStorage from byostorage.cached import CachedStorage -from library.music_tags import MusicTag, auto_tag -from interface.utils import sign_data +from polyphonic.library.music_tags import MusicTag, auto_tag +from polyphonic.interface.utils import sign_data import logging diff --git a/app/library/music_tags.py b/polyphonic/library/music_tags.py similarity index 100% rename from app/library/music_tags.py rename to polyphonic/library/music_tags.py diff --git a/app/library/pdf_utils.py b/polyphonic/library/pdf_utils.py similarity index 100% rename from app/library/pdf_utils.py rename to polyphonic/library/pdf_utils.py diff --git a/app/library/templates/library/collection_list.html b/polyphonic/library/templates/library/collection_list.html similarity index 100% rename from app/library/templates/library/collection_list.html rename to polyphonic/library/templates/library/collection_list.html diff --git a/app/library/templates/library/document_annotate.html b/polyphonic/library/templates/library/document_annotate.html similarity index 100% rename from app/library/templates/library/document_annotate.html rename to polyphonic/library/templates/library/document_annotate.html diff --git a/app/library/templates/library/document_confirm_delete.html b/polyphonic/library/templates/library/document_confirm_delete.html similarity index 100% rename from app/library/templates/library/document_confirm_delete.html rename to polyphonic/library/templates/library/document_confirm_delete.html diff --git a/app/library/templates/library/document_entry.html b/polyphonic/library/templates/library/document_entry.html similarity index 100% rename from app/library/templates/library/document_entry.html rename to polyphonic/library/templates/library/document_entry.html diff --git a/app/library/templates/library/folder_detail.html b/polyphonic/library/templates/library/folder_detail.html similarity index 100% rename from app/library/templates/library/folder_detail.html rename to polyphonic/library/templates/library/folder_detail.html diff --git a/app/library/templates/library/gdrive.html b/polyphonic/library/templates/library/gdrive.html similarity index 100% rename from app/library/templates/library/gdrive.html rename to polyphonic/library/templates/library/gdrive.html diff --git a/app/library/templates/library/item_list.html b/polyphonic/library/templates/library/item_list.html similarity index 100% rename from app/library/templates/library/item_list.html rename to polyphonic/library/templates/library/item_list.html diff --git a/app/library/templates/library/item_list_manage.html b/polyphonic/library/templates/library/item_list_manage.html similarity index 100% rename from app/library/templates/library/item_list_manage.html rename to polyphonic/library/templates/library/item_list_manage.html diff --git a/app/library/templates/library/project_detail.html b/polyphonic/library/templates/library/project_detail.html similarity index 100% rename from app/library/templates/library/project_detail.html rename to polyphonic/library/templates/library/project_detail.html diff --git a/app/library/templates/library/project_menu.html b/polyphonic/library/templates/library/project_menu.html similarity index 100% rename from app/library/templates/library/project_menu.html rename to polyphonic/library/templates/library/project_menu.html diff --git a/app/library/templates/library/storage_browser.html b/polyphonic/library/templates/library/storage_browser.html similarity index 100% rename from app/library/templates/library/storage_browser.html rename to polyphonic/library/templates/library/storage_browser.html diff --git a/app/library/templates/library/work_detail.html b/polyphonic/library/templates/library/work_detail.html similarity index 100% rename from app/library/templates/library/work_detail.html rename to polyphonic/library/templates/library/work_detail.html diff --git a/app/library/templates/library/work_list.html b/polyphonic/library/templates/library/work_list.html similarity index 100% rename from app/library/templates/library/work_list.html rename to polyphonic/library/templates/library/work_list.html diff --git a/app/library/templates/library/work_parts_fragment.html b/polyphonic/library/templates/library/work_parts_fragment.html similarity index 100% rename from app/library/templates/library/work_parts_fragment.html rename to polyphonic/library/templates/library/work_parts_fragment.html diff --git a/app/library/templates/library/work_partset.html b/polyphonic/library/templates/library/work_partset.html similarity index 100% rename from app/library/templates/library/work_partset.html rename to polyphonic/library/templates/library/work_partset.html diff --git a/polyphonic/library/tests/__init__.py b/polyphonic/library/tests/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/app/library/tests/test_indexers.py b/polyphonic/library/tests/test_indexers.py similarity index 91% rename from app/library/tests/test_indexers.py rename to polyphonic/library/tests/test_indexers.py index 5654bf7..6e18f15 100644 --- a/app/library/tests/test_indexers.py +++ b/polyphonic/library/tests/test_indexers.py @@ -1,9 +1,9 @@ from django.test import TestCase from tempfile import TemporaryDirectory -from library.models import Collection, Work -from library.indexer import index_works, model_search -from library.indexer import whoosh +from polyphonic.library.models import Collection, Work +from polyphonic.library.indexer import index_works, model_search +from polyphonic.library.indexer import whoosh JAZZ_STANDARDS = ( ["But Not For Me", "Gershwin, George & Ira"], diff --git a/app/library/tests/test_library.py b/polyphonic/library/tests/test_library.py similarity index 98% rename from app/library/tests/test_library.py rename to polyphonic/library/tests/test_library.py index 123ac52..5c768fc 100644 --- a/app/library/tests/test_library.py +++ b/polyphonic/library/tests/test_library.py @@ -1,7 +1,7 @@ -from interface.tests import AccessTestCase +from polyphonic.interface.tests import AccessTestCase from byostorage.user import UserStorage -from library import models +from polyphonic.library import models import tempfile import json diff --git a/app/library/tests/test_modules.py b/polyphonic/library/tests/test_modules.py similarity index 100% rename from app/library/tests/test_modules.py rename to polyphonic/library/tests/test_modules.py diff --git a/app/library/urls.py b/polyphonic/library/urls.py similarity index 99% rename from app/library/urls.py rename to polyphonic/library/urls.py index 61653cf..5bffbcb 100644 --- a/app/library/urls.py +++ b/polyphonic/library/urls.py @@ -3,7 +3,7 @@ from django.urls import path from . import views from .gdrive import views as gdrive_views -from library.views import api +from .views import api # router = routers.DefaultRouter() # router.register(r'collection', external.CollectionViewSet, basename="collection") diff --git a/app/library/views/__init__.py b/polyphonic/library/views/__init__.py similarity index 97% rename from app/library/views/__init__.py rename to polyphonic/library/views/__init__.py index 2b482b2..d621484 100644 --- a/app/library/views/__init__.py +++ b/polyphonic/library/views/__init__.py @@ -17,13 +17,13 @@ import json import os.path import string -from interface.views import ProjectMixin, AuthorizedResourceMixin -from interface.utils import signed_url -from library.models import Collection, Work, Document, Section -from library.music_tags import MUSIC_TAGS, MusicTag -from library import forms, models -from library.pdf_utils import extract_pages, extract_and_concat -from library.indexer import indexer, model_search +from polyphonic.interface.views import ProjectMixin, AuthorizedResourceMixin +from polyphonic.interface.utils import signed_url +from polyphonic.library.models import Collection, Work, Document, Section +from polyphonic.library.music_tags import MUSIC_TAGS, MusicTag +from polyphonic.library import forms, models +from polyphonic.library.pdf_utils import extract_pages, extract_and_concat +from polyphonic.library.indexer import indexer, model_search import logging diff --git a/app/library/views/api.py b/polyphonic/library/views/api.py similarity index 95% rename from app/library/views/api.py rename to polyphonic/library/views/api.py index 283599d..15ed98f 100644 --- a/app/library/views/api.py +++ b/polyphonic/library/views/api.py @@ -1,10 +1,10 @@ -from interface.views import AuthorizedResourceMixin +from polyphonic.interface.views import AuthorizedResourceMixin from rest_framework import serializers from rest_framework.exceptions import APIException from rest_framework import generics -from library.models import Collection, Work, Document, Section, WorkMeta +from polyphonic.library.models import Collection, Work, Document, Section, WorkMeta import requests @@ -20,13 +20,13 @@ Views relating to importing and exporting collection items """ """ -from interface.views import EnsembleMixin -from library.views import WorkMixin +from polyphonic.interface.views import EnsembleMixin +from polyphonic.library.views import WorkMixin from django.views.generic import View from django.http import JsonResponse from djantic import ModelSchema -from library.models import Work, Document, Section +from polyphonic.library.models import Work, Document, Section class DocumentSchema(ModelSchema): class Config: diff --git a/app/manage.py b/polyphonic/manage.py similarity index 96% rename from app/manage.py rename to polyphonic/manage.py index 0409c26..837d079 100755 --- a/app/manage.py +++ b/polyphonic/manage.py @@ -7,7 +7,7 @@ import sys def main(): """Run administrative tasks.""" - os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.settings.base") + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "polyphonic.config.settings.base") try: from django.core.management import execute_from_command_line except ImportError as exc: diff --git a/app/requirements.txt b/polyphonic/requirements.txt similarity index 100% rename from app/requirements.txt rename to polyphonic/requirements.txt diff --git a/pyproject.toml b/pyproject.toml index 79340f4..81f6f74 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -19,8 +19,8 @@ dependencies = [ "tzdata (>=2026.2,<2027.0)", ] -[tool.poetry] -packages = [{ include = "*", from = "app" }] +#[tool.poetry] +#packages = [{ include = "*", from = "app" }] [tool.poetry.group.dev.dependencies] django-debug-toolbar = "5.2" @@ -28,7 +28,7 @@ ruff = "^0.15.12" coverage = "^7.14.0" [tool.poetry.scripts] -poly-tool = "manage:main" +poly-tool = "polyphonic.manage:main" [tool.ruff] extend-exclude = ["**/migrations/"]