... パーサは、パラメータを取得して Node オブジェクトを作成する必要があります: from django import template def do_current_time ( parser , token ): try : # split_contents() knows not to split quoted strings. tag_name , format_string = token . split_contents ( ... taxError ( " %r tag's argument should be in quotes" % tag_name ) return CurrentTimeNode ( format_string [ 1 : - 1 ]) メモ: parser はテンプレートパーサーオブジェクトです。この例では不要です。 token.contents はタグの生の内容を表す文字列です。この例では ' ... ルタ登録と同様に、これをデコレータとして使うこともできます。 @register . tag ( name = "current_time" ) def do_current_time ( parser , token ): ... @register . tag def shout ( parser , token ): ... name 引数を省略した場合、上記の2番目の例と同じように、Dja ... ... パーサは、パラメータを取得して Node オブジェクトを作成する必要があります: from django import template def do_current_time ( parser , token ): try : # split_contents() knows not to split quoted strings. tag_name , format_string = token . split_contents ( ... taxError ( " %r tag's argument should be in quotes" % tag_name ) return CurrentTimeNode ( format_string [ 1 : - 1 ]) メモ: parser はテンプレートパーサーオブジェクトです。この例では不要です。 token.contents はタグの生の内容を表す文字列です。この例では ' ... ルタ登録と同様に、これをデコレータとして使うこともできます。 @register . tag ( name = "current_time" ) def do_current_time ( parser , token ): ... @register . tag def shout ( parser , token ): ... name 引数を省略した場合、上記の2番目の例と同じように、Dja ... ... t Question as Poll class Command ( BaseCommand ): help = "Closes the specified poll for voting" def add_arguments ( self , parser ): parser . add_argument ( "poll_ids" , nargs = "+" , type = int ) def handle ( self , * args , ** options ): for poll_id ... ムオプションは、次のように add_arguments() メソッドで追加できます: class Command ( BaseCommand ): def add_arguments ( self , parser ): # Positional arguments parser . add_argument ( "poll_ids" , nargs = "+" , type = int ) # Named (optional) arguments par ... ommand ): def __init__ ( self , * args , ** kwargs ): super () . __init__ ( * args , ** kwargs ) # ... BaseCommand. create_parser ( prog_name , subcommand , ** kwargs ) [ソース] ¶ CommandParser インスタンスを返します。これは ArgumentParser サブクラスで ... ... s and Django's cookie parsing could allow an attacker to set arbitrary cookies leading to a bypass of CSRF protection. The parser for request.COOKIES is simplified to better match the behavior of browsers and to mitigate this attack. request.COOKIES ma ... es request リリースノート September fixes security issue site interaction between parsing allow attacker arbitrary leading parser simplified better match behavior クイック検索 Last update: 2026年10月09日 « previous | up | next » ... ... t Question as Poll class Command ( BaseCommand ): help = "Closes the specified poll for voting" def add_arguments ( self , parser ): parser . add_argument ( "poll_ids" , nargs = "+" , type = int ) def handle ( self , * args , ** options ): for poll_id ... ムオプションは、次のように add_arguments() メソッドで追加できます: class Command ( BaseCommand ): def add_arguments ( self , parser ): # Positional arguments parser . add_argument ( "poll_ids" , nargs = "+" , type = int ) # Named (optional) arguments par ... ommand ): def __init__ ( self , * args , ** kwargs ): super () . __init__ ( * args , ** kwargs ) # ... BaseCommand. create_parser ( prog_name , subcommand , ** kwargs ) [ソース] ¶ CommandParser インスタンスを返します。これは ArgumentParser サブクラスで ... ... s and Django's cookie parsing could allow an attacker to set arbitrary cookies leading to a bypass of CSRF protection. The parser for request.COOKIES is simplified to better match the behavior of browsers and to mitigate this attack. request.COOKIES ma ... request リリースノート September セキュリティ 問題 修正 site interaction between parsing allow attacker arbitrary leading parser simplified better match behavior クイック検索 Last update: 2026年10月09日 « previous | up | next » ... ... estrictive value. This host validation is disabled when DEBUG is True or when running tests. XML deserialization ¶ The XML parser in the Python standard library is vulnerable to a number of attacks via external entities and entity expansion. Django use ... s this parser for deserializing XML-formatted database fixtures. The fixture deserializer is not intended for use with untrusted data, b ... ... estrictive value. This host validation is disabled when DEBUG is True or when running tests. XML deserialization ¶ The XML parser in the Python standard library is vulnerable to a number of attacks via external entities and entity expansion. Django use ... s this parser for deserializing XML-formatted database fixtures. The fixture deserializer is not intended for use with untrusted data, b ... ... estrictive value. This host validation is disabled when DEBUG is True or when running tests. XML deserialization ¶ The XML parser in the Python standard library is vulnerable to a number of attacks via external entities and entity expansion. Django use ... s this parser for deserializing XML-formatted database fixtures. This deserializer is not intended for use with untrusted data, but in o ... ... estrictive value. This host validation is disabled when DEBUG is True or when running tests. XML deserialization ¶ The XML parser in the Python standard library is vulnerable to a number of attacks via external entities and entity expansion. Django use ... s this parser for deserializing XML-formatted database fixtures. This deserializer is not intended for use with untrusted data, but in o ... 2026年10月08日