Flask入门教程
movies|length }} Titles- {% for movie in movies %} {# 迭代 movies 变量 #}
- {{ movie.title }} - {{ movie.year }} {# 等同于 movie['title'] #} {% endfor %} {# 使用 endfor # ... @app.route('/') def index(): return render_template('index.html', name=name, movies=movie s) 为了更好的表示这个视图函数的作用,我们把原来的函数名 hello 改为 index ,意思是“索引”,即主页。 在传入 render_template() 函数的关键字参数中,左边的 电影列表 */ .movie-list { list-style-type: none; padding: 0; margin-bottom: 10px; box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rg ba(0, 0, 0, 0.12); } .movie-list li {
0 码力 | 127 页 | 7.62 MB | 1 年前3Mypy 1.8.0 Documentation
object: def new_user(user_class): user = user_class() # (Here we could write the user object to a database) return user How would we annotate this function? Without the ability to parameterize type, the represent objects with a fixed schema, such as {'id': 1, 'items': ['x']}. Here is a typical example: movie = {'name': 'Blade Runner', 'year': 1982} Only a fixed set of string keys is expected ('name' and keys are supported. This is clearly not a good fit for movie above. Instead, you can use a TypedDict to give a precise type for objects like movie, where the type of each dictionary value depends on the0 码力 | 234 页 | 902.89 KB | 1 年前3Mypy 1.10.0+dev Documentation
def new_user(user_class): user = user_class() # (Here we could write the user object to a database) return user How would we annotate this function? Without the ability to parameterize type represent objects with a fixed schema, such as {'id': 1, 'items': ['x']}. Here is a typical example: movie = {'name': 'Blade Runner', 'year': 1982} Only a fixed set of string keys is expected ('name' and keys are supported. This is clearly not a good fit for movie above. Instead, you can use a TypedDict to give a precise type for objects like movie, where the type of each dictionary value depends on the0 码力 | 318 页 | 270.84 KB | 1 年前3Mypy 1.8.0 Documentation
def new_user(user_class): user = user_class() # (Here we could write the user object to a database) return user How would we annotate this function? Without the ability to parameterize type represent objects with a fixed schema, such as {'id': 1, 'items': ['x']}. Here is a typical example: movie = {'name': 'Blade Runner', 'year': 1982} Only a fixed set of string keys is expected ('name' and keys are supported. This is clearly not a good fit for movie above. Instead, you can use a TypedDict to give a precise type for objects like movie, where the type of each dictionary value depends on the0 码力 | 318 页 | 271.55 KB | 1 年前3Mypy 1.10.0+dev Documentation
object: def new_user(user_class): user = user_class() # (Here we could write the user object to a database) return user How would we annotate this function? Without the ability to parameterize type, the represent objects with a fixed schema, such as {'id': 1, 'items': ['x']}. Here is a typical example: movie = {'name': 'Blade Runner', 'year': 1982} Only a fixed set of string keys is expected ('name' and keys are supported. This is clearly not a good fit for movie above. Instead, you can use a TypedDict to give a precise type for objects like movie, where the type of each dictionary value depends on the0 码力 | 234 页 | 913.89 KB | 1 年前3Flask Documentation (1.1.x)
Extensions Deploying to a Web 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 aims to keep the core simple but extensible. Flask won’t make many decisions for you, such as what database to use. Those decisions that it does make, such as what templating engine to use, are easy to change that Flask can be everything you need and nothing you don’t. By default, Flask does not include a database abstraction layer, form validation or anything else where different libraries already exist that0 码力 | 428 页 | 895.98 KB | 1 年前3Flask Documentation (1.1.x)
aims to keep the core simple but extensible. Flask won’t make many decisions for you, such as what database to use. Those decisions that it does make, such as what templating engine to use, are easy to change that Flask can be everything you need and nothing you don’t. By default, Flask does not include a database abstraction layer, form validation or anything else where different libraries already exist that functionality to your appli- cation as if it was implemented in Flask itself. Numerous extensions provide database integration, form validation, upload handling, various open authentication technologies, and more0 码力 | 291 页 | 1.25 MB | 1 年前3PyMuPDF 1.12.2 documentation
Flags Annotation Types Annotation Flags Annotation Line End Styles Color Database Function getColor() Printing the Color Database Appendix 1: Performance Part 1: Parsing Part 2: Text Extraction Part Quote from the Adobe PDF Reference 1.7: “An annotation associates an object such as a note, sound, or movie with a location on a page of a PDF document, or provides a way to interact with the user by means width, height = fitz.PaperSize("A4-L"). 6. To simplify color specification, we provide a Color Database. This allows you to specify color = getColor("turquoise"), without bothering about any more details0 码力 | 387 页 | 2.70 MB | 1 年前3Django 2.2.x Documentation
views Design your templates This is just the surface Quick install guide Install Python Set up a database Install Django Verifying That’s it! Writing your first Django app, part 1 Creating a project The development server Creating the Polls app Write your first view Writing your first Django app, part 2 Database setup Creating models Activating models Playing with the API Introducing the Django Admin Writing Apache and mod_wsgi Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases0 码力 | 2915 页 | 2.83 MB | 1 年前3Django 2.1.x Documentation
views Design your templates This is just the surface Quick install guide Install Python Set up a database Install Django Verifying That’s it! Writing your first Django app, part 1 Creating a project The development server Creating the Polls app Write your first view Writing your first Django app, part 2 Database setup Creating models Activating models Playing with the API Introducing the Django Admin Writing Apache and mod_wsgi Get your database running Install the Django code Models and databases Models Making queries Aggregation Search Managers Performing raw SQL queries Database transactions Multiple databases0 码力 | 2790 页 | 2.71 MB | 1 年前3
共 458 条
- 1
- 2
- 3
- 4
- 5
- 6
- 46