From 3841bbe5b5ba1f6a6e91d92e5bf38a79ad0d341f Mon Sep 17 00:00:00 2001 From: Ee Durbin Date: Thu, 20 Jul 2023 15:11:35 -0400 Subject: [PATCH] collectstatic --- Dockerfile.cabotage | 1 + pydotorg/settings/static.py | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+) create mode 100644 pydotorg/settings/static.py diff --git a/Dockerfile.cabotage b/Dockerfile.cabotage index 1b0057d71..881c6bc78 100644 --- a/Dockerfile.cabotage +++ b/Dockerfile.cabotage @@ -9,3 +9,4 @@ COPY prod-requirements.txt /code/ COPY requirements.txt /code/ RUN pip install -r requirements.txt COPY . /code/ +RUN DJANGO_SETTINGS_MODULE=pydotorg.settings.static python manage.py collectstatic --noinput diff --git a/pydotorg/settings/static.py b/pydotorg/settings/static.py new file mode 100644 index 000000000..3d93e113e --- /dev/null +++ b/pydotorg/settings/static.py @@ -0,0 +1,25 @@ +import os + +import dj_database_url +import raven +from decouple import Csv + +from .base import * + +DEBUG = TEMPLATE_DEBUG = False + +HAYSTACK_CONNECTIONS = { + 'default': { + 'ENGINE': 'haystack.backends.elasticsearch5_backend.Elasticsearch5SearchEngine', + 'URL': 'http://127.0.0.1:9200', + 'INDEX_NAME': 'haystack-null', + }, +} + +MIDDLEWARE = [ + 'whitenoise.middleware.WhiteNoiseMiddleware', +] + MIDDLEWARE + +MEDIAFILES_LOCATION = 'media' +DEFAULT_FILE_STORAGE = 'custom_storages.storages.MediaStorage' +STATICFILES_STORAGE = 'custom_storages.storages.PipelineManifestStorage'