Skip to content

Commit

Permalink
bring back compression
Browse files Browse the repository at this point in the history
  • Loading branch information
fgregg committed Nov 2, 2023
1 parent 68b14a5 commit 2282051
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions asset_dashboard/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@
# Set the DJANGO_DEBUG environment variable to False to disable debug mode
DEBUG = False if os.getenv('DJANGO_DEBUG', True) == 'False' else True

# Are we part of a deployment, and if so what's the ID
DEPLOYMENT_ID = os.getenv("DEPLOYMENT_ID", False)

# Define DJANGO_ALLOWED_HOSTS as a comma-separated list of valid hosts,
# e.g. localhost,127.0.0.1,.herokuapp.com
allowed_hosts = os.getenv('DJANGO_ALLOWED_HOSTS', [])
Expand Down Expand Up @@ -178,8 +181,8 @@

COMPRESS_ENABLED = True

# Enable offline compression in production only
COMPRESS_OFFLINE = not DEBUG
# Only use online compression when we are developing locally and debug is on
COMPRESS_OFFLINE = not DEBUG and not DEPLOYMENT_ID

# Make sure Django compressor can generate static paths
COMPRESS_OFFLINE_CONTEXT = {'static': static}
Expand Down Expand Up @@ -218,4 +221,3 @@
# remove decimal places for djmoney
CURRENCY_DECIMAL_PLACES = 0

DEPLOYMENT_ID = os.environ["DEPLOYMENT_ID"]
2 changes: 1 addition & 1 deletion scripts/after_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $VENV_DIR/bin/pip install -r $PROJECT_DIR/requirements.txt --upgrade
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py migrate
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py createcachetable
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py collectstatic --no-input
#env $(cat .env | xargs) $VENV_DIR/bin/python manage.py compress
env $(cat .env | xargs) $VENV_DIR/bin/python manage.py compress
)

# Set the ownership of the project files and the virtual environment
Expand Down

0 comments on commit 2282051

Please sign in to comment.