From 59deeffefed77bbfcc9861a262d83a8d28fb969b Mon Sep 17 00:00:00 2001 From: Tris Forster Date: Fri, 2 Dec 2022 13:24:31 +1100 Subject: [PATCH] Improved upload --- .dockerignore | 2 + .gitignore | 5 ++- Dockerfile | 20 ++++++++++ .../templates/interface/project_base.html | 4 +- app/interface/urls.py | 7 +++- app/library/forms.py | 2 +- .../migrations/0002_auto_20221201_0934.py | 28 ++++++++++++++ .../migrations/0003_auto_20221201_1540.py | 21 ++++++++++ app/library/models.py | 34 +++++++++-------- .../templates/library/collection_list.html | 5 ++- .../library/document_confirm_delete.html | 22 +++++++++++ .../templates/library/document_entry.html | 17 +++++++++ .../templates/library/work_detail.html | 19 +--------- app/library/urls.py | 4 +- app/library/views.py | 38 +++++++++++++------ docker_settings.py | 8 ++++ 16 files changed, 183 insertions(+), 53 deletions(-) create mode 100644 .dockerignore create mode 100644 Dockerfile create mode 100644 app/library/migrations/0002_auto_20221201_0934.py create mode 100644 app/library/migrations/0003_auto_20221201_1540.py create mode 100644 app/library/templates/library/document_confirm_delete.html create mode 100644 app/library/templates/library/document_entry.html create mode 100644 docker_settings.py diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..76bf1fd --- /dev/null +++ b/.dockerignore @@ -0,0 +1,2 @@ +local_settings.py +db.sqlite3 \ No newline at end of file diff --git a/.gitignore b/.gitignore index 12f382c..f40d561 100644 --- a/.gitignore +++ b/.gitignore @@ -2,11 +2,12 @@ __pycache__ *.pyc db.sqlite3 credentials -polyphonic/settings.py +local_settings.py env +old test.* static teststore cache local_storage -media \ No newline at end of file +media diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d2eb8f --- /dev/null +++ b/Dockerfile @@ -0,0 +1,20 @@ +FROM alpine:3.14 + +RUN apk add --no-cache python3 git ghostscript sqlite + +WORKDIR /root +RUN python3 -m ensurepip +RUN pip3 install -U pip --no-cache-dir + +COPY app /opt/polyphonic +WORKDIR /opt/polyphonic + +COPY docker_settings.py polyphonic/local_settings.py + +RUN pip3 install -r requirements.txt --no-cache-dir + +RUN mkdir /var/polyphonic +RUN SECRET_KEY=_ python3 manage.py collectstatic --noinput + +ENTRYPOINT ["python3", "manage.py"] +CMD ["runserver", "0.0.0.0:8000", "--insecure"] \ No newline at end of file diff --git a/app/interface/templates/interface/project_base.html b/app/interface/templates/interface/project_base.html index 08f7733..4ee91af 100644 --- a/app/interface/templates/interface/project_base.html +++ b/app/interface/templates/interface/project_base.html @@ -42,14 +42,14 @@ {% endif %} - {% if request.is_admin %} - {% endif %}