per page, with , order by , clip by
Results of 1 - 6 of about 6 for KeyError (0.003 sec.)
Django 1.9.6 リリースノート 11680
Django 1.9.6 リリースノート May 2, 2016 Django 1.9.6 では、1.9.5 にあったいくつかのバグを修正しました。 バグ修正 Added support for relative path redirects to the test client and to SimpleTestCase.assertRedirects() because Django 1.9 no long ... references a functools.partial ( #26475 ). Fixed a regression where SessionBase.pop() returned None rather than raising a KeyError for nonexistent values ( #26520 ). Fixed a regression causing the cached template loader to crash when using template name ...
https://man.mtool.work/django/6.1/releases/1.9.6.html
はじめての Django アプリ作成、その 4 10291
はじめての Django アプリ作成、その 4 このチュートリアルは チュートリアルその 3 の続きです。ここでは、引き続きWeb投票アプリケーションの開発を例にして、簡単なフォー ム処理とコードの縮小化を中心に解説します。 困ったときは: このチュートリアルの ... tion , pk = question_id ) try : selected_choice = question . choice_set . get ( pk = request . POST [ "choice" ]) except ( KeyError , Choice . DoesNotExist ): # Redisplay the question voting form. return render ( request , "polls/detail.html" , { "questi ... されないようにするために、 request.POST を明示的に使っています。 POST データに choice がなければ、 request.POST['choice'] は KeyError を送出します。上のコードでは KeyError をチェックし、 choice がない場合にはエラーメッセージ付きの質問フォームを再表示します ...
https://man.mtool.work/django/6.1/intro/tutorial04.html
リクエストとレスポンスのオブジェクト 10291
リクエストとレスポンスのオブジェクト 簡単な概要 Django は、システムを通じてステータスを渡すために、リクエストとレスポンスのオブジェクトを使います。 あるページがリクエストされたとき、Django はリクエストに関するメタデータを含んだ HttpRequest ... name-salt" ) 'Tony' # assuming cookie was set using the same salt >>> request . get_signed_cookie ( "nonexistent-cookie" ) KeyError: 'nonexistent-cookie' >>> request . get_signed_cookie ( "nonexistent-cookie" , False ) False >>> request . get_signed_cook ... 。キーは存在するが値がない場合は空リスト( [] )を返します。キーが存在しない場合は django.utils.datastructures.MultiValueDictKeyError を送出します。(これは Python 標準の KeyError のサブクラスなので、単に KeyError を捕捉しても構いません。) >>> q = QueryDi ... eryDict. pop ( key ) [ソース] 指定されたキーに対応する値のリストを返し、それらを辞書から削除します。キーが存在しない場合は KeyError を発生させます。例えば: >>> q = QueryDict ( "a=1&a=2&a=3" , mutable = True ) >>> q . pop ( "a" ) ['1', '2', '3'] QueryDict ...
https://man.mtool.work/django/6.1/ref/request-response.html
Django 6.1.3 release notes 8445
Django 6.1.3 release notes November 3, 2026 Django 6.1.3 fixes five security issues with severity "low", one security issue with severity "moderate", and several bugs in 6.1.2. It also adds compatibility with Python 3.15. CVE-2026-108147: P ... es had already modified locally or loaded via refresh_from_db() with an explicit fields argument. The fix also addresses a KeyError when a peer's row had been deleted ( #37436 ). Fixed a regression in Django 6.1 where the YAML serializer crashed if passe ...
https://man.mtool.work/django/6.1/releases/6.1.3.html
セッションの使いかた 7969
セッションの使いかた Django は、匿名のセッションをフルサポートしています。このセッションフレームワークを使えば、任意のデータを、サイトの訪問者ごとに保存し、取得できます。データはサーバー側に保存され、クッキーの送受信によって抽象化します。ク ... av_color'] = 'blue' __delitem__ ( key ) 例: del request.session['fav_color'] 与えられた key がセッション内にない場合には、 KeyError 例外を起こします。 __contains__ ( key ) 例: 'fav_color' in request.session __bool__ () New in Django 6.1. Returns the inve ... r" >>> # subsequent requests following serialization & deserialization >>> # of session data >>> request . session [ 0 ] # KeyError >>> request . session [ "0" ] 'bar' 同様に、 '\xd9' のような UTF-8 以外のバイトなど、JSONでエンコードできないデータは保存で ... に対応するメンバーのログアウト処理を行います。 def logout ( request ): try : del request . session [ "member_id" ] except KeyError : pass return HttpResponse ( "You're logged out." ) ふつう実際に使われる django.contrib.auth.logout() 関数では、データの意 ...
https://man.mtool.work/django/6.1/topics/http/sessions.html
Python プログラマーのための Django テンプレート言語 6123
Python プログラマーのための Django テンプレート言語 この文書は Django テンプレートシステムがどのように動作し、どのように拡張するか、技術的な観点から説明します。構文に関するリファレンスを探しているなら、 Django テンプレート言語 を参照してくだ ... ntext ({ "foo" : "bar" }) >>> c [ "foo" ] 'bar' >>> del c [ "foo" ] >>> c [ "foo" ] Traceback (most recent call last): ... KeyError : 'foo' >>> c [ "newvariable" ] = "hello" >>> c [ "newvariable" ] 'hello' Context. get ( key , otherwise = None ) もし key ...
https://man.mtool.work/django/6.1/ref/templates/api.html
PREV 1 NEXT