推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
maloneleo88
V2EX  ›  Python

怎么把 JS 嵌入到 django 自带管理后台的页面中?

  •  
  •   maloneleo88 · Apr 13, 2022 · 2935 views
    This topic created in 1516 days ago, the information mentioned may be changed or developed.

    是去 django\contrib\admin\templates\admin 里改模板还是 有别的好方法?

    改模板的话我要改自定义 models 类新增数据的页面的话改哪个模板?

    谢谢。

    ps.粉墙越来越厉害了,为了发个贴折腾半天、nmmp

    3 replies    2022-04-13 23:46:26 +08:00
    lyhapple
        1
    lyhapple  
       Apr 13, 2022   ❤️ 1
    项目里新建 templates\admin 目录, 把官方 admin 的 base.html 复制进去,再改一下
    ruanimal
        2
    ruanimal  
       Apr 13, 2022
    可以直接扩展 admin 的 template
    maloneleo88
        3
    maloneleo88  
    OP
       Apr 13, 2022
    @lyhapple 明白来了 按模板查找优先顺序,, 谢老哥
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1078 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 23:18 · PVG 07:18 · LAX 16:18 · JFK 19:18
    ♥ Do have faith in what you're doing.