上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 78 下一页
摘要: 通过管道符 "|" 来使用过滤器,{{ value|过滤器:参数 }} Django 的模板语言中提供了六十个左右的内置过滤器 urls.py: from django.conf.urls import url from django.contrib import admin from app01 阅读全文
posted @ 2019-07-26 19:56 Sch01aR# 阅读(1189) 评论(0) 推荐(0)
摘要: 前言: 在 Django 模板语言中变量用 {{ }},逻辑用 {% %} 在 urls.py 中添加对应关系 from django.conf.urls import url from django.contrib import admin from app01 import views urlp 阅读全文
posted @ 2019-07-25 22:57 Sch01aR# 阅读(3064) 评论(0) 推荐(0)
摘要: 在作者列表页面的操作栏中加上编辑按钮 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>作者列表</title> </head> <body> <h1>作者列表</h1> <table border="1"> 阅读全文
posted @ 2019-07-24 22:39 Sch01aR# 阅读(364) 评论(0) 推荐(0)
摘要: 修改 author_list.html,添加删除按钮 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>作者列表</title> </head> <body> <h1>作者列表</h1> <table bord 阅读全文
posted @ 2019-07-24 20:40 Sch01aR# 阅读(523) 评论(0) 推荐(0)
摘要: 在 book_list.html 的页面下方加上 “添加作者” 的链接 <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>作者列表</title> </head> <body> <h1>作者列表</h1> <t 阅读全文
posted @ 2019-07-24 20:00 Sch01aR# 阅读(713) 评论(0) 推荐(0)
摘要: 在 views.py 中添加展示作者列表的函数 from django.shortcuts import render, redirect, HttpResponse from app01 import models # 展示出版社列表 def publisher_list(request): pa 阅读全文
posted @ 2019-07-24 17:10 Sch01aR# 阅读(562) 评论(0) 推荐(0)
摘要: models.py 代码: from django.db import models # Create your models here. # 出版社 class Publisher(models.Model): id = models.AutoField(primary_key=True) # 自 阅读全文
posted @ 2019-07-24 15:11 Sch01aR# 阅读(287) 评论(0) 推荐(0)
摘要: 展示书籍列表: 首先修改原先的 book_list.html 的代码: <!DOCTYPE html> <!-- saved from url=(0042)https://v3.bootcss.com/examples/dashboard/ --> <html lang="zh-CN"> <head 阅读全文
posted @ 2019-07-23 22:04 Sch01aR# 阅读(356) 评论(0) 推荐(0)
摘要: 在 app01/models.py 中添加 Book 类对象表 from django.db import models # Create your models here. # 出版社 class Publisher(models.Model): id = models.AutoField(pri 阅读全文
posted @ 2019-04-25 22:58 Sch01aR# 阅读(255) 评论(0) 推荐(0)
摘要: 准备工作: 首先创建一个名为 Py_Django 的数据库 新建项目,名为 mysite0 创建完成后需要进行几项配置 mysite0/settings.py 下 首先是 html 文件相关 其次是数据库配置 最后注释掉 CSRF 的代码 在 mysite0/__init__.py 中添加以下代码 阅读全文
posted @ 2019-04-23 20:33 Sch01aR# 阅读(387) 评论(0) 推荐(0)
上一页 1 ··· 44 45 46 47 48 49 50 51 52 ··· 78 下一页