问题
In Dajaxice's installation documentation, it says to set DAJAXICE_MEDIA_PREFIX
in settings.py
. Later that value is retrieved in the urls.py
.
In Dajax's installation documentation (which is 2 years old), it says to load the static file like this:
<script src="{{ MEDIA_URL }}/js/prototype.dajax.core.js.js" type="text/javascript" charset="utf-8"></script>
Why is it using MEDIA_URL
? Shouldn't it be using STATIC_URL
since js
, css
, and img
files should be STATIC
?
回答1:
You're right, their docs are out-of-date for Django > 1.3 I believe. Just replace MEDIA_URL
with STATIC_URL
as you've already mentioned, e.g.,
<script type='text/javascript' src='{{STATIC_URL}}js/dajaxice.core.js'
charset='utf-8'></script>
来源:https://stackoverflow.com/questions/10083334/why-does-dajaxice-and-dajax-uses-medial-url