diff options
| author | Bobby <[email protected]> | 2022-07-18 11:45:40 +0530 |
|---|---|---|
| committer | Bobby <[email protected]> | 2022-07-18 11:45:40 +0530 |
| commit | dc79c87045474066128733e03c5e7e70a5d508dd (patch) | |
| tree | 1bd22f33eaf7e6c8bba03bcd75ef9b08993770c4 | |
| parent | 92bfcab3712b99129e0fc8f768965b0945868ba4 (diff) | |
| download | thatcomputerscientist-dc79c87045474066128733e03c5e7e70a5d508dd.tar.xz thatcomputerscientist-dc79c87045474066128733e03c5e7e70a5d508dd.zip | |
Added whitenoise
| -rw-r--r-- | Dockerfile | 6 | ||||
| -rw-r--r-- | requirements.txt | 1 | ||||
| -rw-r--r-- | thatcomputerscientist/settings.py | 3 |
3 files changed, 5 insertions, 5 deletions
@@ -17,12 +17,10 @@ RUN pip install -r requirements.txt COPY . . -# RUN python manage.py collectstatic --noinput +RUN python manage.py collectstatic --noinput EXPOSE 8080 # replace APP_NAME with module name -# CMD ["gunicorn", "--bind", ":8080", "--workers", "2", "thatcomputerscientist.wsgi"] -CMD ["python3", "manage.py", "runserver", "8080"] - +CMD ["gunicorn", "--bind", ":8080", "--workers", "2", "thatcomputerscientist.wsgi"] diff --git a/requirements.txt b/requirements.txt index c470db6a..ee3b114b 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,3 +2,4 @@ Django==4.0.6 python-dotenv==0.20.0 mysqlclient==2.1.1 gunicorn==20.1.0 +whitenoise=6.2.0 diff --git a/thatcomputerscientist/settings.py b/thatcomputerscientist/settings.py index 9d788d5e..168e0239 100644 --- a/thatcomputerscientist/settings.py +++ b/thatcomputerscientist/settings.py @@ -51,6 +51,7 @@ MIDDLEWARE = [ 'django.contrib.auth.middleware.AuthenticationMiddleware', 'django.contrib.messages.middleware.MessageMiddleware', 'django.middleware.clickjacking.XFrameOptionsMiddleware', + 'whitenoise.middleware.WhiteNoiseMiddleware', ] ROOT_URLCONF = 'thatcomputerscientist.urls' @@ -134,4 +135,4 @@ STATIC_URL = 'static/' # https://docs.djangoproject.com/en/4.0/ref/settings/#default-auto-field DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField' -STATIC_ROOT = os.path.join(BASE_DIR, 'static') +STATIC_ROOT = BASE_DIR / "staticfiles" |
