Django on Heroku - Broken Admin Static Files

前端 未结 9 632
天命终不由人
天命终不由人 2020-12-24 14:37

I have a Django app running on Heroku/Cedar, configured as per the instructions at https://devcenter.heroku.com/articles/django

Using gunicorn as per Heroku\'s instr

9条回答
  •  暖寄归人
    2020-12-24 15:19

    If you use runserver and configure your app with DEBUG=True, then it will serve the admin files just like on your development machine. However, this is definitely not the recommended way to do it, and I would suggest that you put them on S3.

    Using the django-storages app it's very easy to configure collectstatic to automatically push all the admin files to S3. You can find directions here

提交回复
热议问题