Django 官方教程翻译项目可以开始翻译咯。 6. PR。 README - 5 - 本文档使用 书栈(BookStack.CN) 构建 初识 Django 初识 Django 设计模型 创建模型 享用便捷的 API 动态生成的管理页面:并非徒有其表 规划 URL 编写视图 设计模板 这只是冰山一角 Django 最初被设计用于具有快速开发需求的新闻类站点,目的是要实现简单快捷的网站开发。以下 内容简要介绍了如何使用 r.full_name = 'Billy Goat' 64. >>> r.save() 65. 66. # 用 delete() 来删除一个对象。 67. >>> r.delete() 动态生成的管理页面:并非徒有其表 初识 Django - 8 - 本文档使用 书栈(BookStack.CN) 构建 当你的模型完成定义,Django 就会自动生成一个专业的生产级管理页面 - 一个可以让已认证用户 有一个自动执行数据库迁移并同步管理你的数据库结构的命令 - 这个命令是 migrate, 我们马上就会接触它 - 但是首先,让我们看看迁移命令会执行哪些 SQL 语句。sqlmigrate 命令 接收一个迁移的名称,然后返回对应的 SQL: 1. $ python manage.py sqlmigrate polls 0001 你应该会看到类似下面这样的输出(我们已经把输出重组成了可读的格式):0 码力 | 103 页 | 1.86 MB | 1 年前3
Django、Vue 和Element UI 前后端原理论述assert r.json()['name']=='anjing' 通过执行代码,可以发现我们已经模拟请求成功了: 模拟动态 post 请求 上面介绍的是参数都写死了,小编这里模拟一个动态的数据,自己输入内容,然后 后续进行自己校验内容,这里需要自己加入一个函数,将我们动态数据加入到函数中, 然后进行返回。 # coding:utf-8 import requests import requests_mock print(r.text) assert r.status_code == 200 assert r.json()['json']['name']=='anjing' 通过执行代码情况,可以看出,动态数据请求正确。 模拟请求错误异常 正常请求接口的时候,都会出现接口异常情况,比如超时哈,或者请求服务器异常 等操作,接下来小编通过 requests-mock 进行模拟服务器异常的情况 # coding:utf-8 结构数据效果更加明显,在各种主流的编程语言中均有对应的库支持。其语法大致介绍 如下: 40 《51 测试天地》七十四 www.51testing.com 简单来讲,功能编排的核心主要是通过 JSONpath 语法完成参数动态替换,如下图所 示: 3、数据构造及结果反馈 数据构造主要包括明确输入、输出格式等信息,并按照完成组合好的场景完成数据 构造,而结果反馈是将构造完成的数据按照格式反馈给用户。 41 《510 码力 | 61 页 | 6.84 MB | 1 年前3
Django 4.2.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3305 页 | 3.16 MB | 1 年前3
Django 4.1.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3240 页 | 3.13 MB | 1 年前3
Django 5.1 DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.1.2 DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 4.0.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a pre-existing database? If I make changes to a model0 码力 | 3184 页 | 3.14 MB | 1 年前3
Django 2.2.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Session security User-uploaded I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a pre-existing database? If I make changes to a model0 码力 | 2915 页 | 2.83 MB | 1 年前3
Django 5.0.x DocumentationDjango code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases Tablespaces Database access optimization Database Security in Django Cross site scripting (XSS) protection Cross site request forgery (CSRF) protection SQL injection protection Clickjacking protection SSL/HTTPS Host header validation Referrer policy Cross-origin I’ve found a security problem! What should I do? FAQ: Databases and models How can I see the raw SQL queries Django is running? Can I use Django with a preexisting database? If I make changes to a model0 码力 | 3407 页 | 3.21 MB | 1 年前3
Django 4.0.x DocumentationMigrations | Operations reference | SchemaEditor | Writing migrations • Advanced: Managers | Raw SQL | Transactions | Aggregation | Search | Custom fields | Multiple databases | Custom lookups | Query we’ll come to it in a moment - but first, let’s see what SQL that migration would run. The sqlmigrate command takes migration names and returns their SQL: $ python manage.py sqlmigrate polls 0001 You should screen so that you can see what SQL Django thinks is required. It’s useful for checking what Django is going to do or if you have database administrators who require SQL scripts for changes. If you’re0 码力 | 2248 页 | 7.90 MB | 1 年前3
共 36 条
- 1
- 2
- 3
- 4













