我有一个django 1.8应用程序,管理员应用程序和所有其他应用程序在不同的实例上。我希望能够从管理站点中的某个应用程序中撤消网址。这是模式(来自app的urls.py之一):
url(r'/invoice/(?P<uid>[^/]+)/$',
transaction_views.invoice,
name='transaction-invoice'),
由于管理网站中没有Url,因此无法简单地使用reverse('transaction-invoice', args=[tx.uuid])
,但由于代码存在,我可以访问RegexURLPattern
对象。
是否可以从对象生成url(最好不使用实际的正则表达式)并设置基本URL(来自Site
对象)?