简体   繁体   中英

when i run my server in django i get this request error , i've been using bootstrap

when running the server ( python manage.py runserver )and asking for a request in my view i get this error
Not Found: /assets/js/ie10-viewport-bug-workaround.js [13/Dec/2015 14:09:25] "GET /assets/js/ie10-viewport-bug-workaround.js HTTP/1.1" 404 2264

this is my view :

from django.shortcuts import render
from .forms import EmailForm
def home(request):
    print request
    form = EmailForm()
    context = {"form": form}
    template = "home.html"
    return render(request, template, context)

this is the end of my html file that was pulled from bootstrap.
this is the page i took the elements from ( http://getbootstrap.com/examples/jumbotron/ ):

 <!-- Bootstrap core JavaScript
    ================================================== -->
    <!-- Placed at the end of the document so the pages load faster -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
    <script>window.jQuery || document.write('<script src="../../assets/js/vendor/jquery.min.js"><\/script>')</script>
    <script src="http://getbootstrap.com/dist/js/bootstrap.min.js"></script>
  <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <script src="http://getbootstrap.com/assets/js/ie10-viewport-bug-workaround.js"></script>
  </body>
</html>

That script is a workaround for a bug in IE10 . The url ../../assets/... is a relative url that works on the bootstrap site. You can't just copy and paste it to another page and expect it to work.

You'll need to create a new static file that contains the required javascript, or add it to an existing file / script tag.

This is what solved the problem for me. If you are using Chrome:

Open DevTools (Ctrl + Shift + J) -> Settings (F1) -> Disable cache (while DevTools is open).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM