python - django tag "static" fails if url starts with "http://" -
i want allow loading file local external locations.
# template {% static url %} if url http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js have in html this:
/static/http%3a//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js but if url //ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js have proper link:
//ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js why? how can avoid /static/http%3a/?
well don't want use static tag files hosted outside of project. link on template <script src="... type thing.
click here django documentation on topic
so be, in html template, in tag put <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6/jquery.min.js"></script>
if you're saying want able change url dynamically or through settings file, do.
<script src="{{ url }}"></script>
Comments
Post a Comment