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

Popular posts from this blog

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

html - How to style widget with post count different than without post count -

url rewriting - How to redirect a http POST with urlrewritefilter -