vintasoftware / django-react-boilerplate

Django 5, React, Bootstrap 5 with Python 3 and Webpack project boilerplate
MIT License
1.97k stars 479 forks source link

Make collectstatic settings consistent #536

Closed fjsj closed 3 years ago

fjsj commented 3 years ago

See app.json, there's DISABLE_COLLECTSTATIC and ENABLE_DJANGO_COLLECTSTATIC

rvlb commented 3 years ago

This one I want to investigate a bit further because I think DISABLE_COLLECSTATIC is specific for Heroku "native" collectstatic, so we have to rely on ENABLE_DJANGO_COLLECTSTATIC for running our script.

fjsj commented 3 years ago

So I think we should replace ENABLE_DJANGO_COLLECTSTATIC with Heroku's default of DISABLE_COLLECTSTATIC, because I think DISABLE_COLLECTSTATIC is not being used now as we have our own bin/post_compile.

rvlb commented 3 years ago

So it would be: DISABLE_COLLECTSTATIC=1

# In case we've opted to disable Heroku's default collectstatic, run our own
if [ -f bin/run_collectstatic ] && [ -n "$DISABLE_COLLECTSTATIC" ] && [ "$DISABLE_COLLECTSTATIC" == 1 ]; then
    echo "-----> Running run_collectstatic"
    chmod +x bin/run_collectstatic
    bin/run_collectstatic
fi

And there'd be no scenario where we don't run collectstatic (either ours or Heroku's).

fjsj commented 3 years ago

I see what you mean. Let's leave as is then.