... ng are both enabled, and if the project has a URL pattern that accepts any path ending in a slash (many content management systems have such a pattern), then a request to a malicio ... ... _SLASH setting are both enabled, and if the project has a URL pattern that accepts any path ending in a slash (many content management systems have such a pattern), then a request to a malicio ... ... ), ... , ] route The route argument should be a string or gettext_lazy() (see URL パターンを翻訳する ) that contains a URL pattern. The string may contain angle brackets (like <username> above) to capture part of the URL and send it as a keyword argumen ... e, <int:section> matches a string of decimal digits and converts the value to an int . リクエストを処理する際、Djangoは urlpatterns の最初のパターンから処理を開始し、リストを順番に進みながら、リクエストされたURLと各パターンを比較します。一致するパターン ... 理由については、 URL パターンの命名 を参照してください。 re_path() re_path ( route , view , kwargs = None , name = None ) urlpatterns に含める要素を返します。例えば: from django.urls import include , re_path urlpatterns = [ re_path ( r "^index/$" , views ... ... あります。 name パラメータを operator class の名前に設定します。 例: Index ( OpClass ( Lower ( "username" ), name = "varchar_pattern_ops" ), name = "lower_username_idx" , ) varchar_pattern_ops を使用して Lower('username') にインデックスを作成します: Uniqu ... eConstraint ( OpClass ( Upper ( "description" ), name = "text_pattern_ops" ), name = "upper_description_unique" , ) Upper('description') を使って text_pattern_ops を使用してユニーク制約を作成し ... ... ster (Conversion) Tests if the geometry field is spatially related to the lookup geometry by the values given in the given pattern. This lookup requires a tuple parameter, (geom, pattern) ; the form of pattern will depend on the spatial backend: MariaDB ... , PostGIS, SpatiaLite On these spatial backends the intersection pattern is a string comprising nine characters, which define intersections between the interior, boundary, and exterior of the geo ... metry field and the lookup geometry. The intersection pattern matrix may only use the following characters: 1 , 2 , T , F , or * . This lookup type allows users to "fine tune" a specif ... ... dentified there, out of an abundance of caution it's also updated to use textContent . バグ修正 Fixed missing varchar/text_pattern_ops index on CharField and TextField respectively when using AddField on PostgreSQL ( #26889 ). ... ... dentified there, out of an abundance of caution it's also updated to use textContent . バグ修正 Fixed missing varchar/text_pattern_ops index on CharField and TextField respectively when using AddField on PostgreSQL ( #26889 ). Python 2 で非 ASCII 文字列 ... ... なります。 後方互換性 互換性チェックは、Django をアップグレードした後に起こりうる問題を警告します。 2_0.W001 : URL パターン <pattern> の route に (?P< が含まれているか、 ^ で始まっているか、 $ で終わっています。おそらく、 url() から path() に移行する際の見 ... 設定に含まれていない値が指定されています。 URL 以下のチェックがURL設定に対して実行されます: urls.W001 : あなたのURLパターン <pattern> は、 include() を使用して、 route が $ で終わっています。 問題を避けるために、 route からドル記号を削除してください。 url ... s.W002 : URL パターン <pattern> は / から始まる route を持っています。このスラッシュは不要なため削除してください。このパターンが include() で対象としてい ... ... : return HttpResponse ( "Hello, World!" ) Example urls.py : from django.urls import path from myapp.views import MyView urlpatterns = [ path ( "mine/" , MyView . as_view (), name = "my-view" ), ] 属性 http_method_names このビューが受け入れる HTTP メソッ ... jects . all ()[: 5 ] return context Example urls.py : from django.urls import path from myapp.views import HomePageView urlpatterns = [ path ( "" , HomePageView . as_view (), name = "home" ), ] コンテキスト ( ContextMixin を通じて) ビューに対応した URL ... om articles.models import Article class ArticleCounterRedirectView ( RedirectView ): permanent = False query_string = True pattern_name = "article-detail" def get_redirect_url ( self , * args , ** kwargs ): article = get_object_or_404 ( Article , pk = k ... ... standard library, and bundled with Django). With test discovery, tests can be located in any module whose name matches the pattern test*.py . In addition, the test labels provided to ./manage.py test to nominate specific tests to run must now be full Py ... everse() When reversing URLs, Django didn't apply django.utils.http.urlquote to arguments before interpolating them in URL patterns. This bug is fixed in Django 1.6. If you worked around this bug by applying URL quoting before passing arguments to rever ... ny custom password reset URLs, you will need to update them by replacing uidb36 with uidb64 and the dash that follows that pattern with a slash. Also add _\- to the list of characters that may match the uidb64 pattern. 例: url ( r "^reset/(?P<uidb36>[0- ... 2026年10月08日