Skip to content

Commit 1de1c6d

Browse files
committed
Serve collected static files from different dir
1 parent 7cefac9 commit 1de1c6d

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,4 +51,4 @@ tools/generated/*
5151
compose/ingress/certs/*
5252

5353
# static files
54-
test_app/static/
54+
test_app/static_collected/

test_app/scripts/container_startup_uwsgi.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo "settings.DATABASE ..."
1212
$PYTHON manage.py shell -c 'from django.conf import settings; print(settings.DATABASES)'
1313

1414
$PYTHON manage.py migrate
15-
$PYTHON manage.py collectstatic --noinput
15+
$PYTHON manage.py collectstatic --clear --noinput
1616
DJANGO_SUPERUSER_PASSWORD=password DJANGO_SUPERUSER_USERNAME=admin [email protected] $PYTHON manage.py createsuperuser --noinput || true
1717
$PYTHON manage.py authenticators --initialize
1818
$PYTHON manage.py create_demo_data

test_app/settings.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,9 +157,11 @@
157157
ANSIBLE_BASE_TEAM_MODEL = 'test_app.Team'
158158
ANSIBLE_BASE_ORGANIZATION_MODEL = 'test_app.Organization'
159159

160-
STATIC_ROOT = os.path.join(BASE_DIR, 'test_app', 'static')
160+
STATIC_ROOT = os.path.join(BASE_DIR, 'test_app', 'static_collected')
161161
STATIC_URL = '/static/'
162162

163+
STATICFILES_DIRS = [os.path.join(BASE_DIR, 'static'),]
164+
163165
CSRF_TRUSTED_ORIGINS = ['http://localhost', 'https://localhost']
164166

165167
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'

0 commit comments

Comments
 (0)