'Suspicious Operation: Attempted access to “” denied' while loading static files

前端 未结 1 1431
情书的邮戳
情书的邮戳 2020-12-10 16:23

I\'ve been through the ringer getting my Django app setup on Heroku using Amazon s3 to host the static and media files. I\'ve been following this guide https://www.caktusgr

相关标签:
1条回答
  • 2020-12-10 17:29

    Sorted! As expected it was something annoyingly simple but perhaps this will help anyone else who hits the same wall.

    This:

    <link rel="stylesheet" type="text/css" href="{% static '/css/reset.css' %}">
    

    Needed to be this:

    <link rel="stylesheet" type="text/css" href="{% static 'css/reset.css' %}">
    

    I.e. no leading slash in the href. Worked fine using local static files storage but broke the S3 link.

    0 讨论(0)
提交回复
热议问题