... sions from which packaged Django releases were produced, since version 1.0. A number of tags also exist under the archive/ prefix for archived work . The source code for the Djangoproject.com website can be found at github.com/django/djangoproject.com ... ches of Django which are closed and no longer maintained were moved into attic . A number of tags exist under the archive/ prefix to maintain a reference to this and other work of historical interest. The following tags under the archive/attic/ prefix ... applications. This became part of Django as of the 1.0 release. Additionally, the following tags under the archive/attic/ prefix reference the tips of branches that were closed, but whose code was never merged into Django, and the features they aimed ... ... of the actual project. If settings, URLconfs and apps within the project are imported or referenced using the project name prefix (e.g. myproject.settings , ROOT_URLCONF = "myproject.urls" , etc.), the new manage.py will need to be moved one directory ... odels.py mysite/ __init__.py settings.py urls.py If the same code is imported inconsistently (some places with the project prefix, some places without it), the imports will need to be cleaned up when switching to the new manage.py . Custom project and ... ow using URL reversals before the project's URLconf gets loaded. URL パターンを翻訳する Django can now look for a language prefix in the URLpattern when using the new i18n_patterns() helper function. It's also now possible to define translatable URL pa ... ... クショナリ。 form_class インスタンス化するフォームクラス。 success_url フォームが正常に処理されたときにリダイレクトするURL。 prefix 生成されるフォームの prefix 。 get_initial () フォームの初期データを取得します。デフォルトでは、 initial のコピーを返します ... を指定します。 リクエストが POST または PUT の場合、リクエストデータ ( request.POST と request.FILES ) も提供されます。 get_prefix () 生成されるフォームの prefix を特定します。 デフォルトでは prefix を返します。 get_success_url () フォームのバリデーショ ... ... プションのアクセサ): content_type extra_context form_class [ get_form_class() ] http_method_names initial [ get_initial() ] prefix [ get_prefix() ] response_class [ render_to_response() ] success_url [ get_success_url() ] template_engine template_name [ ... me() ] extra_context fields form_class [ get_form_class() ] http_method_names initial [ get_initial() ] model pk_url_kwarg prefix [ get_prefix() ] query_pk_and_slug queryset [ get_queryset() ] response_class [ render_to_response() ] slug_field [ get_sl ... me() ] extra_context fields form_class [ get_form_class() ] http_method_names initial [ get_initial() ] model pk_url_kwarg prefix [ get_prefix() ] query_pk_and_slug queryset [ get_queryset() ] response_class [ render_to_response() ] slug_field [ get_sl ... ... るように、クライアントのコンストラクタにキーワード引数として OPTIONS の内容を渡します。使用例は以下を参照してください。 KEY_PREFIX : Django サーバが使用する全てのキャッシュキーに自動的に含まれる文字列です(デフォルトでは先頭に付加されます)。 詳細は キャ ... ッシュのエイリアス。 CACHE_MIDDLEWARE_SECONDS -- 各ページがキャッシュされるべき秒数を整数で指定します。 CACHE_MIDDLEWARE_KEY_PREFIX -- キャッシュが同じ Django インストールを使っている複数のサイトで共有され ている場合、キーの衝突を防ぐために、サイトの名前 ... ムゾーン も含まれます。 ビューごとのキャッシュ django.views.decorators.cache. cache_page ( timeout , * , cache = None , key_prefix = None ) キャッシュフレームワークをより細かい単位で使用するには、個別のビューの出力をキャッシュする方法があります。 django ... ... な場合はメソッドの動作を理解してからオーバーライドしてください。 empty_form BaseFormSet には追加の属性 empty_form があり、 __prefix__ というプレフィックスとともにフォームのインスタンスを返します。これにより、JavaScript で動的にフォームを操作することが容易 ... は、フォームセットは各フィールド名のプレフィックスを含みます。デフォルトではプレフィックスは 'form' ですが、フォームセットの prefix 引数を使用してカスタマイズすることもできます。 たとえば、デフォルトの場合は次のように表示されます: < label for = "id_form- ... 0-title" > Title: </ label > < input type = "text" name = "form-0-title" id = "id_form-0-title" > しかし、 ArticleFormset(prefix='article') を使うと、以下のようになります: < label for = "id_article-0-title" > Title: </ label > < input type = "text" na ... ... ( #34470 ) に対処し、PostgreSQL のクライアントエンコーディングを UTF-8 に強制しました。 Django 4.2 で、 i18n_patterns() が prefix_default_language 引数にデフォルト言語のフォールバック言語を指定した場合に、 prefix_default_language を尊重していなかったリ ... グレッションを修正しました ( #34455 ). Django 4.2 で、 prefix_default_language を False に設定した i18n_patterns() からデフォルト言語の URL を翻訳すると、異なる言語のリクエストに対して ... ... main onto the target stable/A.B.x branch. A backport commit must include two things beyond the original commit message: A prefix [A.B.x] on the subject line, where A.B.x is the name of the stable/A.B.x branch being targeted. A suffix Backport of <sha> ... w: Option 1: fully manual Cherry-pick the commit onto the stable branch, then amend the commit message to add the required prefix and backport note: git cherry-pick <sha> git commit --amend If the cherry-pick produces conflicts, resolve them, stage the ... in the repo The scripts/backport.sh Bash script automates the cherry-pick and rewrites the commit message with the correct prefix and backport note. Run it from the target stable branch: bash scripts/backport.sh <sha> This is straightforward for clean ... ... に便利なカスタムのアサーションメソッドを多数提供しています。 これらのアサーションメソッドで出力される失敗メッセージは、 msg_prefix 引数でカスタマイズできます。この文字列は、アサーションが生成する失敗メッセージの先頭に付加されます。これにより、テストスイ ... "a@a.com" }, { "aaa" : [ "Enter a valid email address." ]} ) SimpleTestCase. assertFormError ( form , field , errors , msg_prefix = '' ) [ソース] フォーム上のフィールドが提供されたエラーのリストを発生させることをアサートします。 form は Form インスタン ... は errors=['error message'] と同じです。 SimpleTestCase. assertFormSetError ( formset , form_index , field , errors , msg_prefix = '' ) [ソース] レンダリング時に formset が指定されたエラーリストを発生させることをアサートします。 formset は FormSet のイ ... ... "Hi!" > Jinja2 テンプレートを使いますか? Jinja2 で static タグを使う方法については Jinja2 を参照してください。 get_static_prefix 通常は static テンプレートタグの使用を推奨しますが、 STATIC_URL がテンプレートに挿入される場所と方法をより厳密に制御する必 ... 要がある場合は、 get_static_prefix テンプレートタグが使用できます: {% load static %} < img src = " {% get_static_prefix %} images/hi.jpg" alt = "Hi!" > 値を何 ... 度も使う必要がある場合、不要な処理を避けるために使用できる別の方式もあります: {% load static %} {% get_static_prefix as STATIC_PREFIX %} < img src = " {{ STATIC_PREFIX }} images/hi.jpg" alt = "Hi!" > < img src = " {{ STATIC_PREFIX }} image ... 2026年10月08日