2019-08-10 django admin urls

https://docs.djangoproject.com/en/dev/ref/contrib/admin/#reversing-admin-urls
经常会需要手动写admin的页面跳转

################
如何在admin页面中添加跳转按钮,例子如下:

from django.urls import revers
from django.utils.html import format_html

def action(self, obj):
    url = reverse('admin:bills_bill_changelist')
    click = f"location.href = {url!r}"
    html = f''
    return format_html(html)

你可能感兴趣的:(2019-08-10 django admin urls)