在我的 admin.py 我有:
def get_urls(self):
urls = super(AggregationProxyProviderAdmin, self).get_urls()
my_urls = patterns('',
url(r'^(\d+)/import_proxies/$',
self.admin_site.admin_view(self.import_proxies_from_file),
name="import_proxies",
),
)
return my_urls + urls
在 change_form.html 我有
<a href="{% url opts|admin_urlname:'import_proxies' original.pk|admin_urlquote %}" class="btn importlink">
我得到了错误:
Exception Type: NoReverseMatch
Exception Value:
Reverse for 'aggregation_aggregationproxyprovider_import_proxies' with arguments '(1L,)' and keyword arguments '{}' not found.
有人可以解释问题出在哪里吗?谢谢