开发者

django admin printer friendly stylesheet

开发者 https://www.devze.com 2023-01-22 18:24 出处:网络
Has anyone got or know if a printer friendly css file is available fo开发者_C百科r the Django Admin site?If you want to add in a print CSS stylesheet for the admin, add this to your admin/base_site.ht

Has anyone got or know if a printer friendly css file is available fo开发者_C百科r the Django Admin site?


If you want to add in a print CSS stylesheet for the admin, add this to your admin/base_site.html template:

{% block extrastyle %}
   {{block.super}}
   <link rel="stylesheet" href="/path/to/your/print.css" type="text/css" media="print" charset="utf-8">
{% endblock %}


If you're looking to output the contents of the admin site, I would suggest exporting it as a CSV file first and then printing from spreadsheet software.

I have used this in the past and recommend it: https://django-import-export.readthedocs.org/en/latest/

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号