... ワード引数とともに入力されます。 as_view() に extra_context キーワード引数を使用して、コンテキストを追加することもできます。 RedirectView class django.views.generic.base. RedirectView 与えられた URL にリダイレクトします。 与えられた URL は、辞書形式の文字列フォ ... get_redirect_url() Example views.py : from django.shortcuts import get_object_or_404 from django.views.generic.base import RedirectView from articles.models import Article class ArticleCounterRedirectView ( RedirectView ): permanent = False query_string = Tr ... t_redirect_url ( * args , ** kwargs ) Example urls.py : from django.urls import path from django.views.generic.base import RedirectView from article.views import ArticleCounterRedirectView , ArticleDetailView urlpatterns = [ path ( "counter/<int:pk>/" , Arti ... ... xin BaseDateListView クラスベースのジェネリックビュー: フラットインデックス シンプルなジェネリックビュー View TemplateView RedirectView 詳細ビュー DetailView リストビュー ListView 編集ビュー FormView CreateView UpdateView DeleteView 日付ベースのビュー Archiv ... ... たすべてのビューは、指定した URL へのビューのリンクや、送り出す HTTP メソッド、その他よく使われる機能をハンドリングします。 RedirectView は HTTP リダイレクトを行うビュークラス、 TemplateView はベースビューを拡張してテンプレートレンダリングの機能をもたせたビュ ... クラスで設定された属性を上書きします。次の例では TemplateView の template_name を設定しています。同様の上書きのパターンは、 RedirectView の url 属性でも使えます。 ジェネリックビューのサブクラス化 次に、ジェネリックビューのもっと強力な使用例として、既存のビュー ... ... dule django.views.decorators.vary module django.views.generic.base.ContextMixin (組み込みクラス) django.views.generic.base.RedirectView (組み込みクラス) django.views.generic.base.TemplateResponseMixin (組み込みクラス) django.views.generic.base.TemplateView ( ... t_field_name() (AccessMixin のメソッド) (LoginRequiredMiddleware のメソッド) get_redirect_url() (django.views.generic.base.RedirectView のメソッド) get_result() (BaseTaskBackend のメソッド) (Task のメソッド) get_rollback() (django.db.transaction モジュール) ... ath() (django.urls モジュール) (Storage のメソッド) path_info (HttpRequest の属性) pattern_name (django.views.generic.base.RedirectView の属性) per_page (Paginator の属性) PercentRank (django.db.models.functions のクラス) Perimeter (django.contrib.gis.db.mod ... ... s() ] メソッド as_view() dispatch() get() get_context_data() head() http_method_not_allowed() render_to_response() setup() RedirectView class RedirectView 属性 (とオプションのアクセサ): http_method_names pattern_name permanent query_string url [ get_redirect ... ... e methods returning the first or last object matching the filters. Returns None if there are no objects matching. View and RedirectView now support HTTP PATCH method. GenericForeignKey now takes an optional for_concrete_model argument, which when set to Fals ... ります: url ( r "^reset/done/$" , "django.contrib.auth.views.password_reset_complete" , name = "password_reset_complete" , ) RedirectView now has a pattern_name attribute which allows it to choose the target by reversing the URL. In Django 1.4 and 1.5, a blank ... by the standard library instead. This change was also released in Django 1.5.5. The signature of django.views.generic.base.RedirectView.get_redirect_url() has changed and now accepts positional arguments as well ( *args, **kwargs ). Any unnamed captured grou ... ... uments to compiler , and call compiler.quote_name_unless_alias(...) where you previously called qn(...) . Default value of RedirectView.permanent The default value of the RedirectView.permanent attribute will change from True to False in Django 1.9. Using Au ... ... s choices. This allows per-request refreshing when called in a form's __init__() . ジェネリックビュー (汎用ビュー) The new RedirectView.preserve_request attribute allows preserving the HTTP method and body during redirects, using 307/308 status codes instead ... ... orted. The cache_choices option to ModelChoiceField and ModelMultipleChoiceField will be removed. The default value of the RedirectView.permanent attribute will change from True to False . django.contrib.sitemaps.FlatPageSitemap will be removed in favor of d ... ... supported. The cache_choices option to ModelChoiceField and ModelMultipleChoiceField is removed. The default value of the RedirectView.permanent attribute has changed from True to False . django.contrib.sitemaps.FlatPageSitemap is removed in favor of django ... 2026年10月08日