如何在Django管理后台更改链接“Webseite anzeigen”

huangapple go评论57阅读模式
英文:

How to change link in Django admin backend "Webseite anzeigen"

问题

我正在开发一个Django应用程序,同时使用管理员后端和开发的网站,我称之为前端,供用户使用。在管理员后端,右上角有一个名为“Webseite anzeigen”的按钮(Django德语版本)。此按钮的代码由Django提供。该按钮可跳转到网站或前端。我想修改此按钮,但我不确定在哪里找到它。例如,我想增加字体大小并更改颜色。

英文:

I am developing a Django app and using both the admin backend and the developed website, which I refer to as the frontend, for the user. In the admin backend, there is a button "Webseite anzeigen" (Django German version) located at the top right corner. The code for this button is provided by Django. This button leads to the website or the frontend. I want to modify this button but I am not sure where to find it. For example, I want to increase the font size and change the color.

答案1

得分: 2

我已经参考了这里,找到了Django-admin的模板。它们位于您的虚拟环境中,或者django安装的地方,而不是您的项目文件中。对我来说,它们位于:

venv/lib/python3.8/site-packages/django/contrib/admin/templates/admin/

您所指的按钮位于base.html中:

<a href="{{ site_url }}">{{ 'View site' | translate }}</a> /
英文:

I have referred here and found the templates for Django-admin. They are located in your virtual environment--or wherever django is installed--not among your project files. For me, they were located in:

> venv/lib/python3.8/site-packages/django/contrib/admin/templates/admin/

The button you are referring is located in base.html

&lt;a href=&quot;{{ site_url }}&quot;&gt;{% translate &#39;View site&#39; %}&lt;/a&gt; /

huangapple
  • 本文由 发表于 2023年6月19日 22:20:13
  • 转载请务必保留本文链接:https://go.coder-hub.com/76507510.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定