本文介绍了urls.py中的语法错误.如何调试呢?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
错误是这个
"\ t(r'ajax/lookup/^ $','ajaxlookup',name ='ajax_lookup'),\ n"))
"\t(r'ajax/lookup/^$','ajaxlookup',name='ajax_lookup'),\n"))
我已经安装了geonode,并在其中放入了ajax_select来进行自动完成.但是我的URLs.py给出了错误
I have installed geonode and in that I have put ajax_select to do autocomplete. But my URLs.py is giving an error
我的urls.py看起来像这样
My urls.py looks like this
from django.conf.urls.defaults import patterns, url
js_info_dict = {
'packages': ('geonode.maps',),
}
urlpatterns = patterns('geonode.maps.views',
(r'^$', 'maps'),
url(r'^new$', 'newmap', name="map_new"),
(r'^(?P<mapid>\d+)$', 'map_controller'),
(r'^(?P<mapid>\d+)/view$', 'view'),
(r'^(?P<mapid>\d+)/download/$', 'map_download'),
(r'^check/$', 'check_download'),
(r'^embed/$', 'embed'),
(r'^(?P<mapid>\d+)/embed$', 'embed'),
(r'^(?P<mapid>\d+)/data$', 'mapJSON'),
url(r'^search/?$', 'maps_search_page', name='maps_search'),
url(r'^search/api/?$', 'maps_search', name='maps_search_api'),
url(r'^(?P<mapid>\d+)/ajax-permissions$', 'ajax_map_permissions', name='ajax_map_permissions'),
url(r'^change-poc/(?P<ids>\w+)$', 'change_poc', name="change_poc"),
url(r'^search/$', 'maps_search', name='maps_search'),
)
urlpatterns += patterns('geonode.ajax_select.views',
(r'ajax/lookup/^$','ajaxlookup',name='ajax_lookup'),
)
我在html文件中的模板如下
My templates in the html file looks like this
<script type="text/javascript">
Ext.onReady(function(){
{% autoescape off %}
var searchTable = new GeoNode.MapSearchTable({
renderTo: 'search_results',
trackSelection: true,
permalinkURL: '{% url ajax_lookup %}',
searchURL: '{% url ajax_lookup %}',
searchParams: {{init_search}}
});
{% endautoescape %}
});
</script>
我的ajax_lookup看起来像这样
And my ajax_lookup looks like this
推荐答案
Tuples不支持关键字参数.将条目转换为 url()
调用.
Tuples do not support keyword arguments. Convert the entry to a url()
call.
这篇关于urls.py中的语法错误.如何调试呢?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!