Flask Documentation (1.1.x). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 99 1.18 Command Line Interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100 used to protect Flask’s session cookie. • Click is a framework for writing command line applications. It provides the flask command and allows adding custom management commands. Optional dependencies These venv venv If you needed to install virtualenv because you are using Python 2, use the following command instead: 1.3. Installation 5 Flask Documentation (1.1.x), Release 1.1.4 $ python2 -m virtualenv0 码力 | 291 页 | 1.25 MB | 1 年前3
Flask Documentation (1.1.x)Building URLs Error Handlers Extensions Finding Extensions Using Extensions Building Extensions Command Line Interface Application Discovery Run the Development Server Open a Shell Environments Debug Mode Commands Plugins Custom Scripts PyCharm Integration Development Server Command Line In Code Working with the Shell Command Line Interface Creating a Request Context Firing Before/After Request Further Helpers Useful Internals Signals Class-Based Views URL Route Registrations View Function Options Command Line Interface Additional Notes Design notes, legal information and changelog are here for the interested0 码力 | 428 页 | 895.98 KB | 1 年前3
Flask入门教程开发前,我假设你了解了 Python 和 HTML 的基础知识。 你的 Python 版本可以是 2.7,也可以是 3.3 及以上版本。电脑的操作系统可以是 Windows,也可以是 macOS 或 Linux。 安装编辑器和浏览器 对于编辑器来说,每个人都有不同的偏好,你可以自由选择。可以选择功能丰富的 IDE(集成开发环境),比如 PyCharm;也可以选择相对轻量的编辑器,比如 Atom 或 Text。浏览器建议使用 Firefox 或 Chrome。 使用命令行 在本书中,你需要使用命令行窗口来执行许多操作。你可以使用 Windows 下的 cmd.exe,或是 macOS 和 Linux 下的终端(Terminal)。下面我们执行一个最简单 的 whoami 命令(即 Who Am I?): $ whoami greyli 这个命令会打印出当前计算机用户的名称。其他常用的命令还有 实现的终端模拟器) 来代 替系统自带的 cmd.exe,或是使用安装 Git for Windows 后(下一节)附带的 Git Bash。cmder 集成了 Git Bash,支持一些在 Linux 或 macOS 下才能使用的命令 (程序),比如 ls、cat、nano、ssh 等,这些命令我们在后面会用到。 使用 Git Git 是一个流行的版本控制工具,我们可以用它来记录程序源码和文件的变动情0 码力 | 127 页 | 7.62 MB | 1 年前3
Flask-RESTful Documentation Release 0.3.10resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", "zip": "10468", "city": "New York"}}' Note The address field marshal >>> import json >>> >>> address_fields = {} >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 42 页 | 84.60 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.10resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", ˓→ "zip": "10468", "city": "New York"}}' Note: The address Release 0.3.10 (continued from previous page) >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 39 页 | 212.29 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.6resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", ˓→ "zip": "10468", "city": "New York"}}' Note: The address marshal >>> import json >>> >>> address_fields = {} >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 46 页 | 245.60 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.6resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", "zip": "10468", "city": "New York"}}' Note The address field marshal >>> import json >>> >>> address_fields = {} >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 49 页 | 91.90 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.7resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", ˓→ "zip": "10468", "city": "New York"}}' Note: The address Release 0.3.7 (continued from previous page) >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 50 页 | 253.09 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.8resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", ˓→ "zip": "10468", "city": "New York"}}' Note: The address Release 0.3.8 (continued from previous page) >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 50 页 | 253.64 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.8resource_fields['address'] = {} >>> resource_fields['address']['line 1'] = fields.String(attribute='addr1') >>> resource_fields['address']['line 2'] = fields.String(attribute='addr2') >>> resource_fields['address']['city'] '10468'} >>> json.dumps(marshal(data, resource_fields)) '{"name": "bob", "address": {"line 1": "123 fake street", "line 2": "", "state": "NY", "zip": "10468", "city": "New York"}}' Note The address field marshal >>> import json >>> >>> address_fields = {} >>> address_fields['line 1'] = fields.String(attribute='addr1') >>> address_fields['line 2'] = fields.String(attribute='addr2') >>> address_fields['city']0 码力 | 55 页 | 93.30 KB | 1 年前3
共 11 条
- 1
- 2













