Added whitenoise to serve static files

This commit is contained in:
th3r00t
2020-09-11 21:03:11 -04:00
parent f275a5c22a
commit d4a7fb0b7d
4 changed files with 5 additions and 2 deletions

View File

@@ -13,7 +13,7 @@ services:
pyshelf:
image: "pyshelf/pyshelf"
ports:
- "8080:8000"
- "8000:8000"
- "1337:1337"
volumes:
- "${LOCAL_BOOK_DIR}:/books"

3
docker/Dockerfile vendored
View File

@@ -24,4 +24,5 @@ WORKDIR /pyshelf/
RUN python3 -m pip install -r requirements.txt
ENTRYPOINT python3 configure \
daphne --root-path=/pyshelf/src/interface frontend.asgi:application
&& cd src/ \
&& daphne -b 0.0.0.0 -p 8000 frontend.asgi:application

View File

@@ -25,3 +25,4 @@ loguru
ptvsd
pudb
daphne
whitenoise

View File

@@ -55,6 +55,7 @@ INSTALLED_APPS = [
AUTH_USER_MODEL = "interface.User"
MIDDLEWARE = [
"django.middleware.security.SecurityMiddleware",
'whitenoise.middleware.WhiteNoiseMiddleware',
"django.contrib.sessions.middleware.SessionMiddleware",
"django.middleware.common.CommonMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",