1、复制teracher-list.html到templates目录下 2、编辑teacher-list.html,继承base模板 3、编辑organization.views.py 4、配置url,编辑organization.urls.py 5、修改index.html,base.html中的 ...
分类:
其他好文 时间:
2018-03-25 12:09:56
阅读次数:
145
1、编辑course-comment.html 2、编辑courses.views.py 3、配置url 4、在章节前端页面(course-video.html)修改链接 5、在评论前端页面(course-comment.html)修改链接 7、资料下载、讲师提示、课程推荐和之前一样 8、上面的前端 ...
分类:
其他好文 时间:
2018-03-24 22:32:41
阅读次数:
255
inclusion_tag() 在app中新建一个templatetags包(名字固定,不能变,只能是这个), 和views.py、models.py等文件处于同一级别目录下。 这是一个包!不要忘记创建__init__.py文件以使得该目录可以作为Python的包 1.首先,编写Python函数,t ...
分类:
其他好文 时间:
2018-03-22 21:21:46
阅读次数:
163
1.一个基本的Django请求流程 我们先开始写一个基本的请求。这个请求的获取和处理,是使用 urls.py 和 views.py 处理的。我们使用命令 python manage.py runserver 0.0.0.0:8000 启动服务器,这个操作会去读取项目目录下的 settings.py ... ...
分类:
其他好文 时间:
2018-03-22 19:15:51
阅读次数:
151
自定义simple_tag内置的方法首先Django中包含了很多内置的方法:这里通过lower实现在views视图函数中写如下代码:def tp3(request):
name= "ABCDEFG"
return render(request
分类:
其他好文 时间:
2018-03-22 15:59:45
阅读次数:
209
The customer and order tables are often used in joins, thereby resulting in complex queries. You created views to simplify the writing of queries. The ...
分类:
其他好文 时间:
2018-03-22 12:43:51
阅读次数:
161
1.定义项目simplecmdb的url访问路径url(r'^hostinfo/collect/$', 'hostinfo.views.collect'),2.修改hostinfo主机的views.py文件from hostinfo.models import Host
from django.http import
分类:
数据库 时间:
2018-03-22 12:32:10
阅读次数:
233
【问题描写叙述】 rand7是一个能生成1-7的随机数。要求利用rand7生成1-10的随机数。 【算法思想】 1.组合数学方法 第1次 1 2 3 4 5 6 7 之中用rand7取一个数 第2次从 2 3 4 5 6 7 8 之中取一个数 第3次从 3 4 5 6 7 8 9 之中取一个数 第4 ...
分类:
其他好文 时间:
2018-03-21 22:02:07
阅读次数:
153
在MVC中使用Bundle打包压缩js和css 第一步:安装 安装“System.Web.Optimization”:在中“NuGet”中搜索 安装。 第二步:配置 配置“Views”目录下的“web.config”文件增加“System.Web.Optimization”配置 第三部:写代码 在“ ...
分类:
Web程序 时间:
2018-03-21 21:57:56
阅读次数:
193
一、控制台 功能 Windows & Linux Mac 二、代码区 功能 Windows & Linux Mac 三、Editing (Console and Source) Description Windows & Linux Mac 四、Views Description Windows & ...
分类:
编程语言 时间:
2018-03-21 17:32:50
阅读次数:
234