Jinja2 Documentation Release 2.10## Jinja Jinja2 Documentation Release 2.10 November 08, 2017 Powered by TCPDF (www.tcpdf.org) ## Contents I Jinja2 Documentation 1 1 Introduction 3 2 API 7 3 Sandbox 39 4 Native Python Types Asked Questions 121 11 Jinja Changelog 125 Part I JINJA2 DOCUMENTATION # Introduction This is the documentation for the Jinja2 general purpose templating language. Jinja2 is a library for Python at home with Jinja2. It’s both designer and developer friendly by sticking to Python’s principles and adding functionality useful for templating environments. ### 1.1 Prerequisites Jinja2 works with Python0 码力 | 148 页 | 475.08 KB | 2 年前3
Flask Documentation (1.1.x)Flask in detail, with a full reference in the API section. Flask depends on the Jinja [https://www.palletsprojects.com/p/jinja/] template engine and the Werkzeug [https://www.palletsprojects.com/p/werkzeug/] com/p/werkzeug/] WSGI toolkit. The documentation for these libraries can be found at: • Jinja documentation [http://jinja.pocoo.org/docs] • Werkzeug documentation [https://werkzeug.palletsprojects.com/] ## User's Make the Project Installable Test Coverage Deploy to Production Keep Developing! Templates Jinja Setup Standard Context Standard Filters Controlling Autoescaping Registering Filters Context0 码力 | 428 页 | 895.98 KB | 2 年前3
Flask Documentation (1.1.x)in the API section. Flask depends on the Jinja template engine and the Werkzeug WSGI toolkit. The documentation for these libraries can be found at: • Jinja documentation • Werkzeug documentation # cross-site scripting (XSS). Unless you deliberately mark insecure HTML as secure, Flask and the underlying Jinja2 template engine have you covered. But there are many more ways to cause security problems. The documentation interface between applications and servers. • Jinja is a template language that renders the pages your application serves. • MarkupSafe comes with Jinja. It escapes untrusted input when rendering templates0 码力 | 291 页 | 1.25 MB | 2 年前3
Django 5.1 Documentationto use Django's CSRF protection - Using CSRF protection with AJAX - Using CSRF protection in Jinja2 templates - Using the decorator method - Handling rejected requests - Using CSRF protection with system, creatively called the Django template language (DTL), and for the popular alternative Jinja2 [https://jinja.palletsprojects.com/]. Backends for other template languages may be available from third-parties built-in backends are django.template.backends.django.DjangoTemplates and django.template.backends.jinja2.Jinja2. Since most engines load templates from files, the top-level configuration for each engine contains0 码力 | 3513 页 | 3.17 MB | 1 年前3
Django 5.1.2 Documentationto use Django's CSRF protection - Using CSRF protection with AJAX - Using CSRF protection in Jinja2 templates - Using the decorator method - Handling rejected requests - Using CSRF protection with system, creatively called the Django template language (DTL), and for the popular alternative Jinja2 [https://jinja.palletsprojects.com/]. Backends for other template languages may be available from third-parties built-in backends are django.template.backends.django.DjangoTemplates and django.template.backends.jinja2.Jinja2. Since most engines load templates from files, the top-level configuration for each engine contains0 码力 | 3519 页 | 3.17 MB | 1 年前3
Django 4.1.x Documentationto use Django's CSRF protection - Using CSRF protection with AJAX - Using CSRF protection in Jinja2 templates - Using the decorator method - Handling rejected requests - Using CSRF protection with template system, creatively called the Django template language (DTL), and for the popular alternative Jinja2. Backends for other template languages may be available from third-parties. You can also write your built-in backends are django.template.backends.django.DjangoTemplates and django.template.backends.jinja2.Jinja2. Since most engines load templates from files, the top-level configuration for each engine contains0 码力 | 3240 页 | 3.13 MB | 2 年前3
Django 4.0.x Documentationtemplate system, creatively called the Django template language (DTL), and for the popular alternative Jinja2. Backends for other template languages may be available from third-parties. You can also write your built-in backends are django.template.backends.django.DjangoTemplates and django.template.backends.jinja2.Jinja2. Since most engines load templates from files, the top-level configuration for each engine contains { 'BACKEND': 'django.template.backends.jinja2.Jinja2', 'DIRS': [ '/home/html/jinja2', ], }, ] ``` If you call get_template('story_detail0 码力 | 3184 页 | 3.14 MB | 2 年前3
Flask入门教程Python Web 框架,没有之一。 Flask 是典型的微框架,作为 Web 框架来说,它仅保留了核心功能:请求响应处理和模板渲染。这两类功能分别由 Werkzeug(WSGI 工具库)完成和 Jinja(模板渲染库)完成,因为 Flask 包装了这两个依赖,我们暂时不用深入了解它们。 ## 主页 这一章的主要任务就是为我们的程序编写一个简单的主页。主页的 URL 一般就是根地址,即 /。当用 这一章要学习使用的模板渲染引擎——Jinja2 来完成。 按照默认的设置,Flask 会从程序实例所在模块同级目录的 templates 文件夹中寻找模板,我们的程序目前存储在项目根目录的 app.py 文件里,所以我们要在项目根目录创建这个文件夹: $ mkdir templates ## 模板基本语法 在社交网站上,每个人都有一个主页,借助 Jinja2 就可以写出一个通用的模板:({ 这里的缩进只是为了可读性,不是必须的 #} {{% else}}
自我介绍为空
{{%endif}} <# 大部分 Jinja 语句都需要声明关闭 #} Jinja2 的语法和 Python 大致相同,你在后面会陆续接触到一些常见的用法。在模板里,你需要添加特定的定界符将 Jinja2 语句和变量标记出来,下面是三种常用的定界符: • {…} 用来标记变量。 {% ... %} 用来标记语句,比如0 码力 | 127 页 | 7.62 MB | 1 年前3
vLLM v0.6.0 Documentation--chat-template argument: $ vllm serve facebook/opt-125m --chat-template ./examples/template_chatml.jinja This server can be queried in the same format as OpenAI API. For example, list the models: $ curl # If not, the model will use its default chat template. # with open('template_falcon_180b.jinja', "r") as f: # chat_template = f.read() # outputs = llm.chat( # conversations mistralai/Mistral-7B-Instruct-v0.3 \ --chat-template examples/tool_chat_template_mistral.jinja \ --enable-auto-tool-choice --tool-call-parser mistral OR vllm serve --model NousResea0 码力 | 201 页 | 1.26 MB | 3 月前3
Django 4.2.x Documentationonly How to use Django’s CSRF protection Using CSRF protection with AJAX Using CSRF protection in Jinja2 templates Using the decorator method Handling rejected requests Using CSRF protection with caching template system, creatively called the Django template language (DTL), and for the popular alternative Jinja2. Backends for other template languages may be available from third-parties. You can also write your built-in backends are django.template.backends.django.DjangoTemplates and django.template.backends.jinja2.Jinja2. Since most engines load templates from files, the top-level configuration for each engine contains0 码力 | 3305 页 | 3.16 MB | 2 年前3
共 347 条
- 1
- 2
- 3
- 4
- 5
- 6
- 35













