0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

DRF + gunicorn でDjango-Adminの静的ファイルが404になった時にやったこと

Posted at

結論 WhiteNoise をインストールしたらいけました

手順

pipなどでインストール

pip install whitenoise

settingsに以下を追加

MIDDLEWARE = [
    ...
    'whitenoise.middleware.WhiteNoiseMiddleware',
    ...
]

STATICFILES_STORAGE = 'whitenoise.storage.CompressedManifestStaticFilesStorage'

以上

デバッグモードや runserverで起動してる場合は発生しないので、気がつきにくく結構ハマったのでメモ的に

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?