我必须失去一些愚蠢的东西。我在模板中有{%url%},其中操作来自其他应用。它不起作用,但我不知道如果使用其他应用程序中的视图函数或者我只是做一些愚蠢的事情有不同的东西。
呼叫/模板/呼叫/ file.html
<form action="{% url 'upload_image' %}"></form>
图片/ urls.py
from .views import PictureList, PictureCreate, PictureDetail, PictureUpdate, PictureDelete, upload_image
...
url(r'^upload_image/$', upload_image, name='upload_image'),
...
图片/ view.py
def upload_image( request ):
print 'IN IMAGE UPLOAD'
print request
我得到的只是:
NoReverseMatch at /call/4/
Reverse for 'upload_image' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: []
答案 0 :(得分:5)
在来自其他应用程序的网址上调用<mx:LinkBar id="languageTypeButtons"
selectedIndex="0"
itemClick="languageType_changeHandler(null)"
dataProvider="{languageTypes}">
</mx:LinkBar>
<s:ArrayList id="languageTypes">
<fx:String>{MXML}</fx:String>
<fx:String>{HTML}</fx:String>
<fx:String>{ANDROID}</fx:String>
</s:ArrayList>
public static const HTML:String = "HTML";
public static const MXML:String = "MXML";
public static const ANDROID:String = "Android";
时,您应该使用其&#34; namespaced&#34;版本,如:
reverse()
在您的具体情况下,转换为:
{% url 'app_name:app_url' %}