per page, with , order by , clip by
Results of 1 - 6 of about 6 for TemplateSyntaxError (0.016 sec.)
独自のテンプレートタグとフィルタを作る 11808
独自のテンプレートタグとフィルタを作る Django のテンプレート言語は、アプリケーションのプレゼンテーションロジックのニーズに対応するように設計された、多種多様な 埋め込みタグやフィルタ を搭載しています。それでもなお、テンプレート構成要素のコア ... ows not to split quoted strings. tag_name , format_string = token . split_contents () except ValueError : raise template . TemplateSyntaxError ( " %r tag requires a single argument" % token . contents . split ()[ 0 ] ) if not ( format_string [ 0 ] == format_string ... [ - 1 ] and format_string [ 0 ] in ( '"' , "'" )): raise template . TemplateSyntaxError ( " %r tag's argument should be in quotes" % tag_name ) return CurrentTimeNode ( format_string [ 1 : - 1 ]) メモ: parser は ... 堅牢ではありません。常に token.split_contents() を使用することをお勧めします。 この関数は構文エラーに対して django.template.TemplateSyntaxError を親切なメッセージとともに発生させます。 The TemplateSyntaxError exceptions use the tag_name variable. Don't hardcode the ...
https://man.mtool.work/django/6.1/howto/custom-template-tags.html
テンプレートのバックエンドをカスタマイズする 11552
テンプレートのバックエンドをカスタマイズする カスタムのバックエンド ここでは、他のテンプレートシステムを使用するために、カスタムテンプレートバックエンドを実装する方法を説明します。テンプレートバックエンドは django.template.backends.base.Bas ... 装する必要があります。以下は架空の foobar テンプレートライブラリの例です: from django.template import TemplateDoesNotExist , TemplateSyntaxError from django.template.backends.base import BaseEngine from django.template.backends.utils import csrf_input_lazy , csrf_tok ... return Template ( self . engine . from_string ( template_code )) except foobar . TemplateCompilationFailed as exc : raise TemplateSyntaxError ( exc . args ) def get_template ( self , template_name ): try : return Template ( self . engine . get_template ( template_ ... exc : raise TemplateDoesNotExist ( exc . args , backend = self ) except foobar . TemplateCompilationFailed as exc : raise TemplateSyntaxError ( exc . args ) class Template : def __init__ ( self , template ): self . template = template def render ( self , context = ...
https://man.mtool.work/django/6.1/howto/custom-template-backend.html
Django 1.4 リリースノート 8243
Django 1.4 リリースノート March 23, 2012 Django 1.4 へようこそ! These release notes cover the new features , as well as some backwards incompatible changes you'll want to be aware of when upgrading from Django 1.3 or older versions. We've a ... g was True , any exception raised during template rendering (even exceptions unrelated to template syntax) were wrapped in TemplateSyntaxError and re-raised. This was done in order to provide detailed template source location information in the debug 500 page. In D ... m template rendering is now consistent regardless of the value of TEMPLATE_DEBUG , and there's no need to catch and unwrap TemplateSyntaxError in order to catch other errors. truncatechars template filter This new filter truncates a string to be no longer than the ...
https://man.mtool.work/django/6.1/releases/1.4.html
テンプレート 8243
テンプレート Django はウェブフレームワークなので、HTML を動的に生成する便利な手段が必要でした。最も一般的なアプローチは、テンプレートに頼ることです。テンプレートには、出力したい HTML を書いた静的な部分と、動的なコンテンツを挿入する方法を書い ... 。テンプレートが見つからない場合、 TemplateDoesNotExist を発生します。テンプレートが見つかったが無効な構文を含んでいる場合、 TemplateSyntaxError を発生します。 テンプレートがどのように検索され読み込まれるかは、各エンジンのバックエンドと設定によって異なります。 検索を ... す。これは get_template() のような、与えられたテンプレートを複数のエンジンから読み込もうとする関数で使用されます。 exception TemplateSyntaxError ( msg ) [ソース] この例外は、テンプレートが見つかったが、エラーを含んでいる場合に発生します。 get_template() と select_tem ...
https://man.mtool.work/django/6.1/topics/templates.html
Python プログラマーのための Django テンプレート言語 7476
Python プログラマーのための Django テンプレート言語 この文書は Django テンプレートシステムがどのように動作し、どのように拡張するか、技術的な観点から説明します。構文に関するリファレンスを探しているなら、 Django テンプレート言語 を参照してくだ ... } が最初に現れるかどうかを調べます。これは "%}" が文字列リテラルとして使われるのを阻止します。たとえば、以下のような式では TemplateSyntaxError が発生します: {% include "template.html" tvar = "Some string literal with %} in it." %} {% with tvar = "Some string litera ...
https://man.mtool.work/django/6.1/ref/templates/api.html
Django 1.2 リリースノート 7476
Django 1.2 リリースノート 2010 年 5 月 17 日 Django 1.2 へようこそ! Nearly a year in the making, Django 1.2 packs an impressive list of new features and lots of bug fixes. These release notes cover the new features, as well as important cha ... ble names. Now, the keyword status is always enforced, and template code such as {% if not %} or {% if and %} will throw a TemplateSyntaxError . Also, in is a new keyword and so is not a valid variable name in this tag. LazyObject LazyObject is an undocumented-but- ...
https://man.mtool.work/django/6.1/releases/1.2.html
PREV 1 NEXT