From: Patrick Canterino Date: Mon, 28 Feb 2022 10:58:15 +0000 (+0100) Subject: Added "django-filebrowser-no-grappelli" as a upload management tool X-Git-Url: https://git.p6c8.net/pcdenotes.git/commitdiff_plain/b8bbedc407b0f1460c4a371a0fb5cd31dd18417c Added "django-filebrowser-no-grappelli" as a upload management tool --- diff --git a/.gitignore b/.gitignore index 7871bf9..aa59b81 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,6 @@ .venv-old __pycache__ db.sqlite3 +media/uploads/* +!media/uploads/.gitkeep +media/_versions \ No newline at end of file diff --git a/media/uploads/.gitkeep b/media/uploads/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/pcdenotes/settings.py b/pcdenotes/settings.py index 1c79c5c..6225f2f 100644 --- a/pcdenotes/settings.py +++ b/pcdenotes/settings.py @@ -43,6 +43,7 @@ INSTALLED_APPS = [ 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'filebrowser', 'notes', 'notes.templatetags.notes_extras' ] @@ -139,4 +140,7 @@ STATICFILES_DIRS = [BASE_DIR / 'notes/static'] DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' +MEDIA_URL = '/media/' +MEDIA_ROOT = BASE_DIR / 'media' + NOTES_PER_PAGE = 5 \ No newline at end of file diff --git a/pcdenotes/urls.py b/pcdenotes/urls.py index 4832ebe..5685b5d 100644 --- a/pcdenotes/urls.py +++ b/pcdenotes/urls.py @@ -16,7 +16,10 @@ Including another URLconf from django.contrib import admin from django.urls import path, include +from filebrowser.sites import site + urlpatterns = [ + path('admin/filebrowser/', site.urls), path('admin/', admin.site.urls), path('', include('notes.urls')), ] diff --git a/requirements.txt b/requirements.txt index 9f59599..cbbe4ed 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,10 +1,12 @@ asgiref==3.5.0 backports.zoneinfo==0.2.1 Django==4.0.2 +django-filebrowser-no-grappelli==4.0.0 importlib-metadata==4.11.1 Markdown==3.3.6 mysqlclient==2.1.0 packaging==21.3 +Pillow==9.0.1 pyparsing==3.0.7 python-dotenv==0.19.2 pytz==2021.3