class DirectAdmin(admin.ModelAdmin):
def order_pdf(obj):
# return "<a href='{}'>pdf</a>".format(
url=reverse('orders:admin_order_pdf', args=[obj.id])
return "http://localhost:8000" + url
order_pdf.allow_tags = True
order_pdf.short_description = 'PDF bill'
list_display=['id','name','price','phone_number',order_pdf]
admin.site.register(Product)
admin.site.register(Category)
admin.site.register(Direct,DirectAdmin)
This is my admin.py. Here in the admin section of my objects I want to display a link where the link should act as an anchor where it should redirect to that particular link in next tab.
But when I run this code I can see the uri.
I want to make that section in my pdf as an anchor which redirects and opens in another tab
Is that possible?