简体   繁体   English

django:dajax文件在哪里?

[英]django : where is dajax file?

I'm working fine with dajaxice. 我和dajaxice一起工作很好。

Now, I want to use dajax. 现在,我想使用dajax。 I installed it, and I put 我安装了,然后放

<script type="text/javascript" src="{% static 'dajax/jquery.core.js' %}"></script>

that line is changed as 该行更改为

<script type="text/javascript" src="/static/dajax/jquery.core.js"></script>

But there is no js file in that location. 但是该位置没有js文件。

Did I missed somthing? 我错过了什么吗? where is usually that js file? 该js文件通常在哪里?

I think this is caused by url.py setting, since if I check that url, I can see url error page from django. 我认为这是由url.py设置引起的,因为如果我检查该url,则可以从django中看到url错误页面。

--- edited -编辑

When I run -- manage.py collectstatic -- following is log. 当我运行-manage.py collectstatic-以下是日志。

You have requested to collect static files at the destination
location as specified in your settings.

This will overwrite existing files!
Are you sure you want to do this?

Type 'yes' to continue, or 'no' to cancel: yes
Copying '/var/folders/8w/w7cl5wvx1kvd1vkgz83179j00000gn/T/tmpXouwqg'

1 static file copied, 79 unmodified.

In my opinion, 1 static file is just dajaxice file, not dajax file. 我认为1个静态文件只是dajaxice文件,而不是dajax文件。 ( I vi-ed that file ) (我查看了那个文件)

By default, Django will not serve static files unless it is in debug mode (in settings.py, set DEBUG=True , setting this will have a series of other insecure implications). 默认情况下,除非Django处于调试模式,否则它不会提供静态文件(在settings.py中,设置DEBUG=True ,将其设置还有一系列其他不安全的含义)。 However, it provides you a management command for you to collect the static files to a central location ( ./manage.py collectstatic ), then you could configure your web server to serve those files directly, without going through the Django framework. 但是,它为您提供了一个管理命令,可将静态文件收集到一个中央位置( ./manage.py collectstatic ),然后您可以将Web服务器配置为直接提供这些文件,而无需通过Django框架。

The collectstatic command will collect the static files from all the apps installed (and any files specified in the settings STATICFILES_DIRS ) to the directory specified in STATIC_ROOT , assuming that the URL as the setting STATIC_URL . 假设URL为设置STATIC_URLcollectstatic命令将从所有已安装的应用程序的静态文件(以及设置STATICFILES_DIRS指定的任何文件) STATICFILES_DIRSSTATIC_ROOT指定的目录。

For more information, please take a look on these pages from Django document: https://docs.djangoproject.com/en/1.3/howto/static-files 有关更多信息,请查看Django文档中的以下页面: https : //docs.djangoproject.com/en/1.3/howto/static-files

https://docs.djangoproject.com/en/1.3/ref/contrib/staticfiles/ https://docs.djangoproject.com/zh-CN/1.3/ref/contrib/staticfiles/

I answered myself. 我回答了我自己。

Dajax document is not currently supported and not updated. 目前不支持Dajax文档,也未更新。

The dajax file is not 'jquery.js' or somthing, it is, jquery.dajax.core.js. dajax文件不是“ jquery.js”或其他东西,而是jquery.dajax.core.js。

I googled and found many programmer asked about it, but no answer. 我在Google上搜索,发现许多程序员对此提出了疑问,但没有答案。

Checking dajax directory in project App, then you will find jquery.dajax.core.js file. 在项目App中检查dajax目录,然后您将找到jquery.dajax.core.js文件。

Not jquery.core.js as dajax document said. 不像dajax文档所说的jquery.core.js。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM