From b8bbedc407b0f1460c4a371a0fb5cd31dd18417c Mon Sep 17 00:00:00 2001 From: Patrick Canterino Date: Mon, 28 Feb 2022 11:58:15 +0100 Subject: [PATCH] Added "django-filebrowser-no-grappelli" as a upload management tool --- .gitignore | 3 +++ media/uploads/.gitkeep | 0 pcdenotes/settings.py | 4 ++++ pcdenotes/urls.py | 3 +++ requirements.txt | 2 ++ 5 files changed, 12 insertions(+) create mode 100644 media/uploads/.gitkeep 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 -- 2.34.1