我使用django-grappelli在管理网站上创建可排序的内联。偶尔(不可重现-大约50%的时间,这特别奇怪),当我尝试保存内联排序时,Django会抛出以下异常:
Exception Type: NoReverseMatch
Exception Value: Reverse for 'grp_related_lookup' with arguments '()' and keyword arguments '{}' not found.
Exception Location: /usr/local/lib/python2.7/dist-packages/django/template/defaulttags.py in render, line 424令人不快的一行是:
$("#id_" + this).grp_related_fk({lookup_url:"{% url 'grp_related_lookup' %}"});根据this related thread中给出的建议,我已经尝试在shell中快速测试它,但似乎运行良好:
>>> from django.core.urlresolvers import reverse
>>> print reverse('grp_related_lookup')
/grappelli/lookup/related/我不知所措。有没有人有过类似的经历?
Django版本是1.5.1。
发布于 2014-04-18 23:06:39
您可能忘记将grappelli urls添加到您的urls.py中(至少对我来说是这样)
url(r'^grappelli/', include('grappelli.urls')),https://stackoverflow.com/questions/18321026
复制相似问题