【发布时间】:2018-11-21 09:56:39
【问题描述】:
我正在学习 Django
我看到了 django 教程第 7 部分
我想重命名 django 管理页面的名称
所以我做到了
但它没有奏效.....
mysite/mysite/settings.py
TEMPLATES = [
{
'BACKEND': 'django.template.backends.django.DjangoTemplates',
'DIRS': [os.path.join(BASE_DIR, 'templates')],
'APP_DIRS': True,
'OPTIONS': {
'context_processors': [
'django.template.context_processors.debug',
'django.template.context_processors.request',
'django.contrib.auth.context_processors.auth',
'django.contrib.messages.context_processors.messages',
],
},
},
]
mysite/templates/admin/base_site.html
{% extends "admin/base.html" %}
{% block title %}{{ title }} | {{ site_title|default:_('Django site admin') }}{% endblock %}
{% block branding %}
<h1 id="site-name"><a href="{% url 'admin:index' %}">{{ site_header|default:_('mysite') }}</a></h1>
{% endblock %}
{% block nav-global %}{% endblock %}
我从 Django 管理重命名为 mysite
【问题讨论】: