0

在我的 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.

有人可以解释问题出在哪里吗?谢谢

4

1 回答 1

0

解决方案是这样命名 url:aggregation_aggregationproxyprovider_import_proxies

于 2013-11-08T17:35:35.897 回答