... _url 引数など)への URL の逆引きを提供する場合。 関数のシグネチャでパラメータのデフォルト値として逆引きURLを提供する場合。 resolve() ¶ resolve() 関数は、URL パスを対応するビュー関数に解決するために使用できます。次のシグネチャを持っています: resolve ( pa ... nf パラメータについて心配する必要はありません。この関数は、解決された URL に関するさまざまなメタデータにアクセスを許可する ResolverMatch オブジェクトを返します。 URL が解決しない場合、その関数は Resolver404 例外を発生させます( Http404 のサブクラスです) ... 。 class ResolverMatch [ソース] ¶ func ¶ URL を提供するために使用されるビュー関数 args ¶ URL からパースされた、ビュー関数に渡される引数。 k ... ... _url 引数など)への URL の逆引きを提供する場合。 関数のシグネチャでパラメータのデフォルト値として逆引きURLを提供する場合。 resolve() ¶ resolve() 関数は、URL パスを対応するビュー関数に解決するために使用できます。次のシグネチャを持っています: resolve ( pa ... nf パラメータについて心配する必要はありません。この関数は、解決された URL に関するさまざまなメタデータにアクセスを許可する ResolverMatch オブジェクトを返します。 URL が解決しない場合、その関数は Resolver404 例外を発生させます( Http404 のサブクラスです) ... 。 class ResolverMatch [ソース] ¶ func ¶ URL を提供するために使用されるビュー関数 args ¶ URL からパースされた、ビュー関数に渡される引数。 k ... ... T" , "PUT" ): # Redirection preserves the original request method. return redirect ( obj , preserve_request = True ) # ... resolve_url() ¶ resolve_url ( to , * args , ** kwargs ) [ソース] ¶ Returns a URL string by resolving and normalizing the given to ... ion, or view class, possibly with arguments passed as *args and **kwargs , in which case reverse() will be used to reverse-resolve the view. A URL string, which will be returned unchanged. This function is used internally by the redirect() shortcut to d ... " , args = [ self . pk ]) views.py ¶ from django.http import JsonResponse from django.shortcuts import get_object_or_404 , resolve_url from .models import Article def article_api_view ( request , pk ): """Return metadata about an article, including its ... ... T" , "PUT" ): # Redirection preserves the original request method. return redirect ( obj , preserve_request = True ) # ... resolve_url() ¶ resolve_url ( to , * args , ** kwargs ) [ソース] ¶ Returns a URL string by resolving and normalizing the given to ... ion, or view class, possibly with arguments passed as *args and **kwargs , in which case reverse() will be used to reverse-resolve the view. A URL string, which will be returned unchanged. This function is used internally by the redirect() shortcut to d ... " , args = [ self . pk ]) views.py ¶ from django.http import JsonResponse from django.shortcuts import get_object_or_404 , resolve_url from .models import Article def article_api_view ( request , pk ): """Return metadata about an article, including its ... ... . Command ): def get_auto_imports ( self ): return super () . get_auto_imports () + [ "django.urls.reverse" , "django.urls.resolve" , ] The customization above adds resolve() and reverse() to the default namespace, which already includes all models from ... .contrib.contenttypes.models import ContentType from django.contrib.sessions.models import Session from django.urls import resolve, reverse from django.utils import timezone Changed in Django 6.0: Automatic imports of common utilities, such as django.co ... ll import imports インポート models Command オーバーライド auto contrib カスタマイズ management commands 管理 urls reverse resolve カスタム アプリケーション 特定 core self return default imported objects クイック検索 Last update: 2026年10月09日 « previo ... ... . Command ): def get_auto_imports ( self ): return super () . get_auto_imports () + [ "django.urls.reverse" , "django.urls.resolve" , ] The customization above adds resolve() and reverse() to the default namespace, which already includes all models from ... .contrib.contenttypes.models import ContentType from django.contrib.sessions.models import Session from django.urls import resolve, reverse from django.utils import timezone Changed in Django 6.0: Automatic imports of common utilities, such as django.co ... mport imports インポート models Command オーバーライド get auto contrib カスタマイズ management commands 管理 urls reverse resolve カスタム Django 関連するページ カスタム django-admin コマンドの作り方 Django 2.1.3 リリースノート Django 4.1.3 リリースノー ... ... 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 f ... en migrating the database or running tests. In Django 1.7, this could fail silently and result in a missing constraint. To resolve the error, add migrations to the app without them. Features deprecated in 1.8 ¶ Selected methods in django.db.models.optio ... same Form object. This option is subject to an accelerated deprecation and will be removed in Django 1.9. django.template.resolve_variable() ¶ The function has been informally marked as "Deprecated" for some time. Replace resolve_variable(path, context ... ... LazyNonce instance ( #36810 ). Fixed a regression in Django 6.0 where path() routes defined using gettext_lazy() failed to resolve correctly ( #36796 ). Fixed a regression in Django 6.0 where the Widget.use_fieldset attribute of ClearableFileInput was f ... ... 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 f ... en migrating the database or running tests. In Django 1.7, this could fail silently and result in a missing constraint. To resolve the error, add migrations to the app without them. Features deprecated in 1.8 ¶ Selected methods in django.db.models.optio ... same Form object. This option is subject to an accelerated deprecation and will be removed in Django 1.9. django.template.resolve_variable() ¶ The function has been informally marked as "Deprecated" for some time. Replace resolve_variable(path, context ... ... LazyNonce instance ( #36810 ). Fixed a regression in Django 6.0 where path() routes defined using gettext_lazy() failed to resolve correctly ( #36796 ). Fixed a regression in Django 6.0 where the Widget.use_fieldset attribute of ClearableFileInput was f ... 2026年10月08日