JQuery script in Django app - 403 error -
i'm running django app locally using heroku, , s3 media + static files. app includes mini slide show cycles through images on command, , no longer pulling in images, i'm seeing 403 error cycle through slideshow.
- the script embedded in html, not separate file. because know how to call images using
"{{ listing.image1.url }}"
- when click next button, can see cycling through images (although it's showing broken image in browser)
- the s3 setup seems fine - other media , static files are
- surfacing script working fine before moved s3
- i can access images individually html
here script, it's first time writing jquery it's not written , left-scroll bit funky:
<script type = "text/javascript" src = "http://code.jquery.com/jquery-1.8.0.min.js"></script> <script type = "text/javascript"> $(document).ready(function() { var imagename = ["{{ listing.image1.url }}", "{{ listing.image2.url }}", "{{ listing.image3.url }}"]; var indexnum = 1; $("#right-scroll").click(function() { $("#picture").fadeout(30, function() { $("#picture").attr("src", imagename[indexnum]); indexnum++; if (indexnum > 2) {indexnum = 0;} $("#picture").fadein(50); $("#left-scroll").click(function() { $("#picture").fadeout(30, function() { $("#picture").attr("src", imagename[indexnum]); indexnum--; if (indexnum < 0) {indexnum = 2;} $("#picture").fadein(50); }); }); }); }); }); </script>
here relevant html section:
<div id = "image-gallery"> <img id = "picture" src ="{{ listing.image1.url }}"> <img class = "scroll" id = "left-scroll" src="{% static 'left-scroll.jpg' %}"> <img class = "scroll" id = "right-scroll" src="{% static 'right-scroll.jpg' %}"> </div>
add following settings file:
aws_querystring_auth = false
this stop expires query parameter being generated.
Comments
Post a Comment