为什么Dajaxice和Dajax使用MEDIAL_URL? [英] Why does Dajaxice and Dajax uses MEDIAL_URL?

查看:78
本文介绍了为什么Dajaxice和Dajax使用MEDIAL_URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在Dajaxice的安装文档中,它说要设置 DAJAXICE_MEDIA_PREFIX settings.py 中.稍后在 urls.py 中检索该值.

In Dajaxice's installation documentation, it says to set DAJAXICE_MEDIA_PREFIX in settings.py. Later that value is retrieved in the urls.py.

在Dajax的安装文档(已有2年历史)中,它说像这样加载 static 文件:

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>

为什么使用 MEDIA_URL ?它不应该使用 STATIC_URL ,因为 js css img 文件应为 STATIC ?

Why is it using MEDIA_URL? Shouldn't it be using STATIC_URL since js, css, and img files should be STATIC?

推荐答案

您是正确的,我相信他们的文档对于Django> 1.3来说已经过时了.正如您已经提到的,只需将 MEDIA_URL 替换为 STATIC_URL ,例如

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>

这篇关于为什么Dajaxice和Dajax使用MEDIAL_URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆