Flask Documentation (1.1.x)Server Tutorial Project Layout Application Setup Define and Access the Database Blueprints and Views Templates Static Files Blog Blueprint Make the Project Installable Test Coverage Deploy to Production Decorator Based Signal Subscriptions Core Signals Pluggable Views Basic Principle Method Hints Method Based Dispatching Decorating Views Method Views for APIs The Application Context Purpose of the Context WTForms Template Inheritance Message Flashing AJAX with jQuery Custom Error Pages Lazily Loading Views MongoDB with MongoEngine Adding a favicon Streaming Contents Deferred Request Callbacks Adding HTTP0 码力 | 428 页 | 895.98 KB | 1 年前3
Flask Documentation (1.1.x). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 83 1.13 Pluggable Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86 1.14 flaskr.sqlite file in the instance folder in your project. Continue to Blueprints and Views. 1.5.4 Blueprints and Views A view function is the code you write to respond to requests to your application. Create a Blueprint A Blueprint is a way to organize a group of related views and other code. Rather than registering views and other code directly with an application, they are registered with a blueprint0 码力 | 291 页 | 1.25 MB | 1 年前3
Flask-RESTful Documentation Release 0.3.10provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views [http://flask.pocoo.org/docs/views/], giving you easy access to multiple HTTP methods just by defining methods on your view objects, you can also use standard flask view decorators [http://flask.pocoo.org/docs/views/#decorating-views]. Custom Error Handlers Error handling is a tricky problem. Your Flask application may0 码力 | 42 页 | 84.60 KB | 1 年前3
Flask入门教程watchlist # 切换进包目录 $ touch __init__.py views.py errors.py models.py commands.py # 创建多个模块 我们把这个包称为程序包,包里目前包含的模块和作用如下表所示: 模块 作用 __init__.py 包构造文件,创建程序实例 views.py 视图函数 errors.py 错误处理函数 models.py 模型类 模型类 commands.py 命令函数 提示 除了包构造文件外,其他的模块文件名你可以自由修改,比如 views.py 也可 以叫 routes.py。 创建程序实例,初始化扩展的代码放到包构造文件里(__init__.py),如下所示: 第 10 章:组织你的代码 106 import os import sys from flask import Flask from flask_sqlalchemy models import User user = User.query.first() return dict(user=user) from watchlist import views, errors, commands 在构造文件中,为了让视图函数、错误处理函数和命令函数注册到程序实例上,我 们需要在这里导入这几个模块。但是因为这几个模块同时也要导入构造文件中的程 序实例,为了避免循环依赖(A0 码力 | 127 页 | 7.62 MB | 1 年前3
Flask-RESTful Documentation Release 0.3.6provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views [http://flask.pocoo.org/docs/views/], giving you easy access to multiple HTTP methods just by defining methods on your view objects, you can also use standard flask view decorators [http://flask.pocoo.org/docs/views/#decorating-views]. Custom Error Handlers Error handling is a tricky problem. Your Flask application may0 码力 | 49 页 | 91.90 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.8provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views [http://flask.pocoo.org/docs/views/], giving you easy access to multiple HTTP methods just by defining methods on your view objects, you can also use standard flask view decorators [http://flask.pocoo.org/docs/views/#decorating-views]. Custom Error Handlers Error handling is a tricky problem. Your Flask application may0 码力 | 55 页 | 93.30 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.7provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views [http://flask.pocoo.org/docs/views/], giving you easy access to multiple HTTP methods just by defining methods on your view objects, you can also use standard flask view decorators [http://flask.pocoo.org/docs/views/#decorating-views]. Custom Error Handlers Error handling is a tricky problem. Your Flask application may0 码力 | 55 页 | 93.21 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.10building block provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views, giving you easy access to multiple HTTP methods just by defining methods on your resource. A basic0 码力 | 39 页 | 212.29 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.6building block provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views, giving you easy access to multiple HTTP methods just by defining methods on your resource. A basic0 码力 | 46 页 | 245.60 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.7building block provided by Flask-RESTful are resources. Resources are built on top of Flask pluggable views, giving you easy access to multiple HTTP methods just by defining methods on your resource. A basic0 码力 | 50 页 | 253.09 KB | 1 年前3
共 11 条
- 1
- 2













