博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
怎么把顶部的Django administration去掉!!
阅读量:7217 次
发布时间:2019-06-29

本文共 2093 字,大约阅读时间需要 6 分钟。

/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/django/contrib/admin/templates/admin

目录下,有个叫

base_site.html的文件,打开并把Django administration去掉即可

{% extends "admin/base.html" %}{% block title %}{
{ title }} | {
{ site_title|default:_('Django site admin') }}{% endblock %}{% block branding %}

{
{ site_header|default:_('Django Administration') }}

{% endblock %}{% block nav-global %}{% endblock %}

把{

{ site_header|default:_('Django Administration') }} 替换掉

{% extends "admin/base.html" %}{% block title %}{
{ title }} | {
{ site_title|default:_('Django site admin') }}{% endblock %}{% block branding %}

广州XX贸易有限公司

{% endblock %}{% block nav-global %}{% endblock %}

 

 

其中sites.py,是django的源码文件之一,

class AdminSite(object):    """    An AdminSite object encapsulates an instance of the Django admin application, ready    to be hooked in to your URLconf. Models are registered with the AdminSite using the    register() method, and the get_urls() method can then be used to access Django view    functions that present a full admin interface for the collection of registered    models.    """    # Text to put at the end of each page's .    site_title = ugettext_lazy('Django site admin')    # Text to put in each page's 

. site_header = ugettext_lazy('Django administration') # Text to put at the top of the admin index page. index_title = ugettext_lazy('Site administration') # URL for the "View site" link at the top of each admin page. site_url = '/' _empty_value_display = '-' login_form = None index_template = None app_index_template = None login_template = None logout_template = None password_change_template = None password_change_done_template = None

 

 

 

# Text to put at the end of each page's <title>.

site_title = ugettext_lazy('Django site admin')

# Text to put in each page's <h1>.

site_header = ugettext_lazy('Django administration')

# Text to put at the top of the admin index page.

index_title = ugettext_lazy('Site administration')

即可修改admin的界面内容

 

 

 

 

转载于:https://www.cnblogs.com/alan-babyblog/p/5665353.html

你可能感兴趣的文章
第二次作业心得
查看>>
爬虫——请求库之requests
查看>>
android子线程更新UI,与主Thread一起工作
查看>>
50行实现简易HTTP服务器
查看>>
细讲递归(recursion)
查看>>
进程和进程间通信
查看>>
微处理器的两种结构比较
查看>>
ORACLE EXPIRED(GRACE)
查看>>
Markdown应用样例
查看>>
多文本框的值得存放和赋值
查看>>
Linux中计划任务执行脚本crontab-简洁版
查看>>
Java - IO
查看>>
安卓app中嵌入一个H5页面,当手机系统设置字体变大时,如何使H5页面的字体不会随用户自己调整的系统字体变化而变化?...
查看>>
safari 收藏导出 手机safari 导出
查看>>
Dalvik 虚拟机 jvm 区别
查看>>
hexo从零开始
查看>>
币值转换
查看>>
RabbitMQ(六)远程连接
查看>>
得到ios设备的一些信息
查看>>
【教程】如何修改路由表?
查看>>