HerokuにDjangoアプリをデプロイするとcollectstaticが自動実行される

HerokuにDjangoアプリをデプロイしたところ、

remote:  !     Error while running '$ python manage.py collectstatic --noinput'.
remote:        See traceback above for details.
remote: 
remote:        You may need to update application code to resolve this error.
remote:        Or, you can disable collectstatic for this application:
remote: 
remote:           $ heroku config:set DISABLE_COLLECTSTATIC=1
remote: 
remote:        https://devcenter.heroku.com/articles/django-assets
remote:  !     Push rejected, failed to compile Python app.
remote: 
remote:  !     Push failed
remote: Verifying deploy...
remote: 
remote: !   Push rejected to <your app>.

というエラーメッセージが表示されてデプロイできなかった時のメモです。

 
その時のDjangoアプリは、

という構成でした。

 
エラーメッセージより、collectstatic不要なら環境変数DISABLE_COLLECTSTATICを設定すれば良さそうでした。たしかに今回のDjangoアプリは静的ファイルがないので、collectstaticは不要です。

 
また、エラーメッセージの中にあったURLを見たところ、

When a Django application is deployed to Heroku, $ python manage.py collectstatic --noinput is run automatically during the build. A build will fail if the collectstatic step is not successful.

Collectstatic during builds | Django and Static Assets | Heroku Dev Center

と、Herokuへのデプロイ時にはcollectstaticが自動実行されるとのことでした。

 
そこで、

$ heroku config:set DISABLE_COLLECTSTATIC=1
Setting DISABLE_COLLECTSTATIC and restarting ⬢ <your app>... done, v3
DISABLE_COLLECTSTATIC: 1

と、Heroku環境変数を設定しました。

その後、再度デプロイしたところ、問題なく完了しました。