Skip to Content
Web机器学习
book

Web机器学习

by Posts & Telecom Press, Andrea Isoni
May 2024
Intermediate to advanced
234 pages
3h 58m
Chinese
Packt Publishing
Content preview from Web机器学习

第6章 开始Django之旅

开源Web框架Django简单易用,稳定性和灵活性高,因此被广泛应用于商业环境(它充分利用了Python拥有丰富的库这一优势)。

我们可以用Web应用来管理和分析数据,开发Web应用要用到Web框架的相关功能,本章重点讲解Django框架的这些功能。此外,我们还会解释搭建完整的Web应用包括哪些主要环节,但更多细节和信息限于篇幅,不再赘述,请自行查阅官方文档https://docs.djangoproject.com或其他资料。我们将介绍Web服务器应用的主要概念(配置、模型和命令)、HTML和shell的基础知识、REST框架接口的主要概念及在Django中它们是如何实现的(serializer、REST调用和swagger)。我们会简要介绍如何用HTTP GET、POST方法在因特网上传输数据,还会讲解Django的安装方法以及如何用它搭建Web服务器。

超文本传输协议(Hypertext Transfer Protocol,HTTP)实现了客户端(比如Web浏览器)和服务器(我们的应用)之间的交互。给定网页的URL地址,客户端使用GET方法向服务器查询数据,查询词在URL中是以参数形式指定的。若用curl命令来解释,如下所示:

curl -X GET url_path?name1=value1&name2=value2

URL?号符号后面的键值对,指定的是要查询的数据,多项数据之间用&符号分隔。

客户端将数据传送给服务器的方法叫作POST。POST方法将被传输的数据放到请求的body部分:

curl -X POST -d @datafile.txt url_path

现在,我们开始讨论如何用Django搭建Web服务器和Web应用。 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

人工智能技术与大数据

人工智能技术与大数据

Posts & Telecom Press, Anand Deshpande, Manish Kumar
神经网络算法与Java编程

神经网络算法与Java编程

Posts & Telecom Press, Fabio M. Soares, Alan M. F. Souza
Python图像处理实战

Python图像处理实战

Posts & Telecom Press, Sandipan Dey
面向MapReduce的Hadoop优化

面向MapReduce的Hadoop优化

Posts & Telecom Press, Khaled Tannir

Publisher Resources

ISBN: 9781836203612