... 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 maliciously crafted URL of that site could lead ... to a redirect to another site, enabling phishing and other attacks. CommonMiddleware now escapes leading slashes to prevent redirects to other domains. ... ... _SLASH setting are both enabled, and if the project has a URL pattern that accepts any path ending in a slash (many content manag ... t site could lead to a redirect to another site, enabling phishing and other attacks. CommonMiddleware now escapes leading slashes to prevent redirects to other domains. バグ修正 Fixed a regression in Django 2.0.7 that broke the regex lookup on MariaD ... ... into the settings module. Instead of using from django.contrib.auth import LOGIN_URL refer to settings.LOGIN_URL . APPEND_SLASH behavior has been updated In 0.96, if a URL didn't end in a slash or have a period in the final component of its path, and ... APPEND_SLASH was True, Django would redirect to the same URL, but with a slash appended to the end. Now, Django checks to see whether t ... he pattern without the trailing slash would be matched by something in your URL patterns. If so, no redirection takes place, because it is assumed you deliberat ... ... ザーエージェントのアクセスを禁止します。この設定は、コンパイルした正規表現オブジェクトのリストである必要があります。 APPEND_SLASH および PREPEND_WWW 設定に基づいて、URL の書き換えを実行します。 APPEND_SLASH が True で、与えられた URL がスラッシュで終わ ... 別して作成されます。よって、URL を正規化するというのがベストプラクティスなのです。 必要に応じて、個々のビューは、 no_append_slash() デコレータを使用して、 APPEND_SLASH の動作から除外できます。 from django.views.decorators.common import no_append_slash ... @no_append_slash def sensitive_fbv ( request , * args , ** kwargs ): """View to be excluded from APPEND_SLASH.""" return HttpResponse () 非 ... ... ry with more than one & or | operators ( #27143 ). Disabled system check for URL patterns beginning with a '/' when APPEND_SLASH=False ( #27238 ). Fixed model form default fallback for CheckboxSelectMultiple , MultiWidget , FileInput , SplitDateTimeWi ... ... nning the Django test suite with runtests.py when using spatial database backends . MEDIA_URL and STATIC_URL must end in a slash Previously, the MEDIA_URL setting only required a trailing slash if it contained a suffix beyond the domain name. A traili ... ng slash is now required for MEDIA_URL and the new STATIC_URL setting as long as it is not blank. This ensures there is a consisten ... t way to combine paths in templates. Project settings which provide either of both settings without a trailing slash will now raise a PendingDeprecationWarning . In Django 1.4 this same condition will raise DeprecationWarning , and in Djan ... ... 一般) django.views.decorators.common のデコレータで、 CommonMiddleware の動作をビューごとにカスタマイズできます。 no_append_slash () [ソース] このデコレータは、個々のビューを APPEND_SLASH URL 正規化から除外します。 ... ... ey ( #26373 ). Fixed a regression in CommonMiddleware that caused spurious warnings in logs on requests missing a trailing slash ( #26293 ). Restored the functionality of the admin's raw_id_fields in list_editable ( #26387 ). Fixed a regression with a ... ... g with two slashes), which could unexpectedly redirect a user to a different host. An attacker could exploit this, for example, by redirect ... phishing site designed to ask for user's passwords. To remedy this, URL reversing now ensures that no URL starts with two slashes (//), replacing the second slash with its URL encoded counterpart (%2F). This approach ensures that semantics stay the s ... ... the SCRIPT_NAME environment variable or the FORCE_SCRIPT_NAME setting, regardless of whether or not either has a trailing slash (#20169). Fixed an obscure bug with the override_settings() decorator. If you hit an AttributeError: 'Settings' object has ... 2026年10月08日