diff --git a/README-Finder.md b/README-Finder.md index 90a1dbef1..8fa9b6bc6 100644 --- a/README-Finder.md +++ b/README-Finder.md @@ -1,7 +1,7 @@ # Django-Filer ("Finder" branch) The "Finder" branch of django-filer is a complete rewrite of the original **django-filer** project. -It is 'work in progress' and is not yet ready for production use. However, the code is in a state +It is 'work in progress' and not yet ready for production use. However, the code is in a state where it can be used for testing and development purposes. A rewrite was necessary because the original codebase was not maintainable anymore. Please read this @@ -136,7 +136,7 @@ In `settings.py` of your project, add these extra dependencies or those you real 'finder', 'finder.contrib.archive', # supports zip, tar, tar.gz, tar.bz2, tar.xz 'finder.contrib.audio', # supports mp3, ogg, flac, wav - 'finder.contrib.common', # supports pdf, spreadsheets + 'finder.contrib.common', # supports PDF, spreadsheets 'finder.contrib.image.pil', # supports bmp, gif, jpeg, png, tiff 'finder.contrib.image.svg', # supports svg 'finder.contrib.video', # supports mp4, webm, ogv @@ -145,10 +145,9 @@ In `settings.py` of your project, add these extra dependencies or those you real ``` If you use: -* `finder.contrib.audio`, assure that `ffmpeg-python` is installed. +* `finder.contrib.audio` or `finder.contrib.video`, assure that `ffmpeg-python` is installed. * `finder.contrib.image.pil`, assure that `Pillow` is installed. * `finder.contrib.image.svg`, assure that `reportlab` and `svglib` are installed. -* `finder.contrib.video`, assure that `ffmpeg-python` is installed. * Postgres as database, install `psycopg2` or `psycopg2-binary` if available for your platform. Run the migrations for app `finder`: @@ -233,9 +232,9 @@ rendered as HTML, this widget becomes the webcomponent ` with a few additional attributes. The JavaScript part of the widget must be included using the script tag ``. -The testapp provides an example how this field can be used in a form. Just vist the URL -http://localhost:8000/admin/finder/foldermodel/ and click on the blank area to either select an -existing file or upload a new one. +The demonstration app provides an example how this field can be used in a form. Just vist the URL +http://localhost:8000/demoapp/ and click on the blank area to either select an existing file or +upload a new one. ## Permission System (Proposal) @@ -261,7 +260,7 @@ Each `AccessControlEntry` has a these fields: a file, it allows the currently loggedin user to view and use that file. * A generic foreign key pointing onto the `InodeModel`. This creates a one-to-many relation between different file types and folders on one side and the access control list on the other. -* A foreign key onto the folder model to set a permission template. Read below for details. +* A foreign key onto the folder model to set a permission template. Read below for details. * The `execute` flag as seen in Unix file systems and other ACL implementations does not make sense in this context and is not implemented. diff --git a/testapp/__init__.py b/demoapp/__init__.py similarity index 100% rename from testapp/__init__.py rename to demoapp/__init__.py diff --git a/testapp/admin_site.py b/demoapp/admin_site.py similarity index 66% rename from testapp/admin_site.py rename to demoapp/admin_site.py index eb3c12476..eb68bffe9 100644 --- a/testapp/admin_site.py +++ b/demoapp/admin_site.py @@ -4,9 +4,9 @@ from finder.models.folder import FolderModel -class TestappAdminSite(admin.AdminSite): +class DempappAdminSite(admin.AdminSite): pass -admin_site = TestappAdminSite(name="testapp_admin") +admin_site = DempappAdminSite(name="demoapp_admin") admin_site.register(FolderModel, FolderAdmin) diff --git a/testapp/asgi.py b/demoapp/asgi.py similarity index 100% rename from testapp/asgi.py rename to demoapp/asgi.py diff --git a/testapp/manage.py b/demoapp/manage.py similarity index 100% rename from testapp/manage.py rename to demoapp/manage.py diff --git a/testapp/middleware.py b/demoapp/middleware.py similarity index 100% rename from testapp/middleware.py rename to demoapp/middleware.py diff --git a/testapp/migrations/0001_initial.py b/demoapp/migrations/0001_initial.py similarity index 83% rename from testapp/migrations/0001_initial.py rename to demoapp/migrations/0001_initial.py index f14769e47..18346a387 100644 --- a/testapp/migrations/0001_initial.py +++ b/demoapp/migrations/0001_initial.py @@ -1,7 +1,7 @@ -# Generated by Django 4.2.15 on 2024-10-26 08:46 +# Generated by Django 5.2.dev20241203005448 on 2025-01-03 08:36 -from django.db import migrations, models import finder.models.fields +from django.db import migrations, models class Migration(migrations.Migration): @@ -13,7 +13,7 @@ class Migration(migrations.Migration): operations = [ migrations.CreateModel( - name='TestAppModel', + name='DemoAppModel', fields=[ ('id', models.BigAutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')), ('file', finder.models.fields.FinderFileField(blank=True, null=True, verbose_name='Demo File')), diff --git a/testapp/migrations/__init__.py b/demoapp/migrations/__init__.py similarity index 100% rename from testapp/migrations/__init__.py rename to demoapp/migrations/__init__.py diff --git a/testapp/models.py b/demoapp/models.py similarity index 84% rename from testapp/models.py rename to demoapp/models.py index adf855dfb..f58c18258 100644 --- a/testapp/models.py +++ b/demoapp/models.py @@ -3,7 +3,7 @@ from finder.models.fields import FinderFileField -class TestAppModel(models.Model): +class DemoAppModel(models.Model): file = FinderFileField( verbose_name="Demo File", null=True, diff --git a/testapp/settings.py b/demoapp/settings.py similarity index 85% rename from testapp/settings.py rename to demoapp/settings.py index 0cd0e8e09..7420c4688 100644 --- a/testapp/settings.py +++ b/demoapp/settings.py @@ -43,20 +43,18 @@ 'finder.contrib.image.pil', 'finder.contrib.image.svg', 'finder.contrib.video', - 'testapp', + 'demoapp', ] 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.sessions.middleware.SessionMiddleware', + 'demoapp.middleware.AutoLoginMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'django.middleware.csrf.CsrfViewMiddleware', ] -ROOT_URLCONF = 'testapp.urls' +ROOT_URLCONF = 'demoapp.urls' TEMPLATES = [ { @@ -103,20 +101,10 @@ TIME_ZONE = 'UTC' -MIDDLEWARE = [ - 'django.middleware.common.CommonMiddleware', - 'django.contrib.sessions.middleware.SessionMiddleware', - 'testapp.middleware.AutoLoginMiddleware', - 'django.contrib.messages.middleware.MessageMiddleware', - 'django.middleware.csrf.CsrfViewMiddleware', -] - SILENCED_SYSTEM_CHECKS = ['admin.E408'] # required for AutoLoginMiddleware USE_I18N = True -ROOT_URLCONF = 'testapp.urls' - STATICFILES_DIRS = [ ('node_modules', BASE_DIR / 'node_modules'), ] @@ -127,8 +115,6 @@ MEDIA_URL = '/media/' -WSGI_APPLICATION = 'wsgi.application' - LOGGING = { 'version': 1, 'disable_existing_loggers': True, diff --git a/testapp/templates/testapp.html b/demoapp/templates/demoapp.html similarity index 100% rename from testapp/templates/testapp.html rename to demoapp/templates/demoapp.html diff --git a/testapp/urls.py b/demoapp/urls.py similarity index 83% rename from testapp/urls.py rename to demoapp/urls.py index fa587fed9..bd2d27601 100644 --- a/testapp/urls.py +++ b/demoapp/urls.py @@ -1,4 +1,4 @@ -"""testapp URL Configuration +"""demoapp URL Configuration The `urlpatterns` list routes URLs to views. For more information please see: https://docs.djangoproject.com/en/4.1/topics/http/urls/ @@ -20,13 +20,13 @@ from finder.browser import urls as browser_urls -from testapp.views import TestAppView +from demoapp.views import DemoAppView urlpatterns = [ path('admin/', admin.site.urls), - path('finder-api/', include(browser_urls)), - path('testapp/', TestAppView.as_view(), name='testapp'), + path('finder-api/', include(browser_urls)), # endpoints for demoapp + path('demoapp/', DemoAppView.as_view(), name='demoapp'), ] if settings.DEBUG: urlpatterns.extend(static( diff --git a/testapp/views.py b/demoapp/views.py similarity index 59% rename from testapp/views.py rename to demoapp/views.py index d061b2063..31fc9761a 100644 --- a/testapp/views.py +++ b/demoapp/views.py @@ -1,17 +1,17 @@ from django.views.generic.edit import UpdateView -from testapp.models import TestAppModel +from demoapp.models import DemoAppModel -class TestAppView(UpdateView): - model = TestAppModel +class DemoAppView(UpdateView): + model = DemoAppModel fields = '__all__' - template_name = 'testapp.html' + template_name = 'demoapp.html' def get_object(self, queryset=None): - if obj := TestAppModel.objects.first(): + if obj := DemoAppModel.objects.first(): return obj - return TestAppModel.objects.create() + return DemoAppModel.objects.create() def get_success_url(self): return self.request.path diff --git a/testapp/wsgi.py b/demoapp/wsgi.py similarity index 91% rename from testapp/wsgi.py rename to demoapp/wsgi.py index a142a8456..9f55f219d 100644 --- a/testapp/wsgi.py +++ b/demoapp/wsgi.py @@ -1,5 +1,5 @@ """ -WSGI config for testapp project. +WSGI config for demoapp project. It exposes the WSGI callable as a module-level variable named ``application``.