摘要: 在 static 静态文件夹下创建 css 文件夹 home.css 此时 home.css 路径是 'static/css/home.css' 在 对应的 home.html 文件中添加 css 样式 {% block ext_css %} {# <link rel="stylesheet" hr 阅读全文
posted @ 2020-05-16 12:17 Hany47315 阅读(286) 评论(0) 推荐(0)
摘要: 在 templates 文件夹下创建 基类 base.html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>{{ title }}</title> </head> <body> {% block head 阅读全文
posted @ 2020-05-16 09:32 Hany47315 阅读(350) 评论(0) 推荐(0)
摘要: 谨慎使用 自动渲染语法 {{code|safe}} urls.py 中添加对应的函数 url(r'getcode',views.getcode) 在 views.py 中添加 def getcode(request): code = "<h2> HTML 转义示例 </h2>" context_co 阅读全文
posted @ 2020-05-16 07:37 Hany47315 阅读(167) 评论(0) 推荐(0)