... 場合は、同期スレッドを作成し、その中で呼び出してください。これは、 asgiref.sync.sync_to_async() を使用して実現できます。 URL Resolver の例外 URL Resolver の例外は django.urls で定義されています。 Resolver404 exception Resolver404 [ソース] The Resolver404 e ... ... リケーションのインスタンスのリストを生成します。 If there is a current application defined, Django finds and returns the URL resolver for that instance. The current application can be specified with the current_app argument to the reverse() function. url テ ... or-polls/" という結果になります。 クラスベースビューのメソッド内: reverse ( "polls:index" , current_app = self . request . resolver_match . namespace ) テンプレート内: {% url 'polls:index' %} 現在のインスタンスがない場合(例えば、サイトの他の場所でページ ... ... 知使っている場合、 template_name が、レンダリングに使われるテンプレートの名前のみが必要な場合の適切な代替策となるでしょう。 resolver_match レスポンスに対する ResolverMatch のインスタンスです。たとえば、次のようにレスポンスを提供するビューを検証するために ... func 属性を使えます。 # my_view here is a function based view. self . assertEqual ( response . resolver_match . func , my_view ) # Class-based views need to compare the view_class, as the # functions generated by as_view() won ... 't be equal. self . assertIs ( response . resolver_match . func . view_class , MyView ) 指定された URL が見つからない場合、この属性にアクセスすると Resolver404 例外が投げられ ... ... fast-path allows for less queries and less objects fetched into memory. See QuerySet.delete() for details. An instance of ResolverMatch is stored on the request as resolver_match . By default, all logging messages reaching the django logger when DEBUG i ... ... デフォルトのオプション 追加の便利機能 コードから管理コマンドを実行する 出力のリダイレクト Django の例外 Django Core 例外 URL Resolver の例外 データベースの例外 HTTP 例外 セッションの例外 トランザクションの例外 テストフレームワークの例外 Python の例外 ファイ ... ... run the test cases in reverse order ( --reverse ), and to enable SQL logging for failing tests ( --debug-sql ). Added the resolver_match attribute to test client responses. Added several settings that allow customization of test tablespace parameters fo ... ... 、ヘッダーはハイフンの代わりにアンダースコアを使用してもルックアップできます。 {{ request.headers.user_agent }} HttpRequest. resolver_match 解決されたURLを表す ResolverMatch のインスタンスです。この属性は、URLの解決が行われた後にのみ設定されます。つまり、全 ... ... may be a rewritten version of the preferred value or not supplied at all. It is also used by django.setup() to set the URL resolver script prefix outside of the request/response cycle (e.g. in management commands and standalone scripts) to generate corre ... 2026年10月08日