Skip to content

Commit 49a2fc7

Browse files
committed
ADDED collect static
1 parent f3b2aa1 commit 49a2fc7

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

config/settings/base.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
from pathlib import Path
22

3+
import os
4+
35
from decouple import config
46

57

@@ -15,6 +17,7 @@
1517

1618

1719
INSTALLED_APPS = [
20+
"whitenoise.runserver_nostatic",
1821
"django.contrib.admin",
1922
"django.contrib.auth",
2023
"django.contrib.contenttypes",
@@ -70,6 +73,7 @@
7073

7174
MIDDLEWARE = [
7275
"django.middleware.security.SecurityMiddleware",
76+
"whitenoise.middleware.WhiteNoiseMiddleware",
7377
"django.contrib.sessions.middleware.SessionMiddleware",
7478
"django.middleware.common.CommonMiddleware",
7579
"django.middleware.csrf.CsrfViewMiddleware",
@@ -93,9 +97,9 @@
9397
USE_TZ = True
9498

9599

100+
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
101+
# STATICFILES_DIRS = [BASE_DIR / "staticfiles"]
96102
STATIC_URL = "/api/static/"
97-
STATICFILES_DIRS = [BASE_DIR / "static"]
98-
# STATIC_ROOT = BASE_DIR / "static/"
99103

100104
MEDIA_URL = "/images/"
101105
MEDIA_ROOT = BASE_DIR / "images/"

entrypoint.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ python manage.py migrate
55
celery -A config.celery worker -l info &
66
celery -A config.celery beat -l info &
77

8+
python manage.py collectstatic &
9+
810
python manage.py runserver 0.0.0.0:8000 &
911

1012
sleep 5

requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,4 +77,5 @@ django-celery-beat==2.5.0
7777
django-celery-results==2.5.0
7878
psycopg2-binary==2.9.6
7979
# healthcheck
80-
psutil
80+
psutil
81+
whitenoise==6.6.0

0 commit comments

Comments
 (0)