Flask Documentation (1.1.x)Quickstart A Minimal Application What to do if the Server does not Start Debug Mode Routing Static Files Rendering Templates Accessing Request Data Redirects and Errors About Responses Sessions Message Flashing 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 Keep Developing! Templates Configuration Basics Environment and Debug Features Builtin Configuration Values Configuring from Files Configuring from Environment Variables Configuration Best Practices Development / Production Instance0 码力 | 428 页 | 895.98 KB | 1 年前3
Flask Documentation (1.1.x)sensible defaults, and a few conventions when getting started. By conven- tion, templates and static files are stored in subdirectories within the application’s Python source tree, with the names templates versus the actual import name). This is needed so that Flask knows where to look for templates, static files, and so on. For more information have a look at the Flask documentation. 3. We then use the route() automatically implemented for you. 1.4.5 Static Files Dynamic web applications also need static files. That’s usually where the CSS and JavaScript files are coming from. Ideally your web server is configured0 码力 | 291 页 | 1.25 MB | 1 年前3
Flask入门教程Web 开发实战》的读者,模板相关内容可以在第 3 章《模 板》找到,Faker 相关内容可以在第 7 章找到。 第 3 章:模板 28 第 4 章:静态文件 静态文件(static files)和我们的模板概念相反,指的是内容不需要动态生成的文 件。比如图片、CSS 文件和 JavaScript 脚本等。 在 Flask 中,我们需要创建一个 static 文件夹来保存静态文件,它应该和程序模 章:静态文件 33 本章小结 主页现在基本成型了,接下来我们会慢慢完成程序的功能。结束前,让我们提交代 码: $ git add . $ git commit -m "Add static files" $ git push 提示 你可以在 GitHub 上查看本书示例程序的对应 commit:e51c579。 进阶提示 如果你对 CSS 很头疼,可以借助前端框架来完善页面样式,比如 第 11 章:部署上线 113 导航栏包含几个常用的链接,可以打开其他面板: Consoles(控制台):可以打开 Bash、Python Shell、MySQL 等常用的控制 台 Files(文件):创建、删除、编辑、上传文件,你可以在这里直接修改代码 Web:管理 Web 程序 Tasks(任务):创建计划任务 Databases(数据库):设置数据库,免费账户可以使用 MySQL0 码力 | 127 页 | 7.62 MB | 1 年前3
Flask-RESTful Documentation Release 0.3.10file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location='files') Note Only use type=list when location='json'. See this issue for more details [https://github example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 42 页 | 84.60 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.10file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location= ˓→'files') Note: Only use type=list when location='json'. See this issue for more details 1.3.6 Multiple example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 39 页 | 212.29 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.6file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location= ˓→'files') Note: Only use type=list when location='json'. See this issue for more details 1.3.6 Multiple example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 46 页 | 245.60 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.6file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location='files') Note Only use type=list when location='json'. See this issue for more details [https://github example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 49 页 | 91.90 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.7file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location= ˓→'files') Note: Only use type=list when location='json'. See this issue for more details 1.3.6 Multiple example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 50 页 | 253.09 KB | 1 年前3
Flask-RESTful Documentation
Release 0.3.8file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location= ˓→'files') Note: Only use type=list when location='json'. See this issue for more details 1.3.6 Multiple example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 50 页 | 253.64 KB | 1 年前3
Flask-RESTful Documentation Release 0.3.8file uploads parser.add_argument('picture', type=werkzeug.datastructures.FileStorage, location='files') Note Only use type=list when location='json'. See this issue for more details [https://github example, any custom input/output types your resources need to get the job done. In the resource files, you just have your resource objects. So here’s what foo.py might look like: from flask_restful import0 码力 | 55 页 | 93.30 KB | 1 年前3
共 11 条
- 1
- 2













