英文:
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
<a href="{{ site_url }}">{% translate 'View site' %}</a> /
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论