Why does Dajaxice and Dajax uses MEDIAL_URL?

浪尽此生 提交于 2019-12-24 02:24:25

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!