会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
code_explorer
博客园
首页
新随笔
联系
订阅
管理
上一页
1
2
3
4
2018年10月10日
添加静态文件
摘要: 在setting.py设置中添加路径 STATICFILES_DIRS = [ os.path.join(BASE_DIR, 'static'), ] //默认与app文件夹平行
阅读全文
posted @ 2018-10-10 00:13 code_explorer
阅读(154)
评论(0)
推荐(0)
2018年10月9日
template_共享模板
摘要: 方法: 定义一个基本框架html文件 举例:定义{标题.内容.页尾}区块 定义相应的html文件实现区块的具体样式或内容 定义具体静态网页html文件时调用这些区块html文件, 实现公共元素的重现 使用 {% *** %} 语句可以在html文件中添加代码操作 各个模板之间的调用方法 :{% in
阅读全文
posted @ 2018-10-09 23:08 code_explorer
阅读(265)
评论(0)
推荐(0)
template_showpost
摘要: 使用<a href='...'>name<\a>实现点击"name"与转向'...'网址的超链接操作 from django.shortcut import redirect导入redirect方法: return redirect('/')实现返回首页
阅读全文
posted @ 2018-10-09 22:00 code_explorer
阅读(202)
评论(0)
推荐(0)
template_homepage
摘要: homepage用到的方法 使用 {% for ... in ...%} 加 {% endfor %} 实现循环结构 举例: {% for post in posts %} <p style = "font -family: 微软雅黑;font-size: 16pt;letter-spacing:1
阅读全文
posted @ 2018-10-09 17:50 code_explorer
阅读(201)
评论(0)
推荐(0)
上一页
1
2
3
4
公告