... ーへのアクセスを制限できます。アクセスが制限されるとき、これらのデコレータは django.http.HttpResponseNotAllowed を返します。 require_http_methods ( request_method_list ) [ソース] ビューが特定のリクエストメソッドのみを受け付けるようにするデコレータです。以 ... 下のように使います。 from django.views.decorators.http import require_http_methods @require_http_methods ([ "GET" , "POST" ]) def my_view ( request ): # I can assume now that only GET or POST ... requests make it this far # ... pass リクエストメソッドは大文字で指定する必要があることに注意してください。 require_GET () ビューがGETメソッドのみを受け付けるようにするデコレータです。 require_POST () ビューがPOSTメソッドのみを受け付けるよ ... ... クラスのイテラブルを返します。 アプリのレジストリが完全に入力されている必要があります。 AppConfig. get_model ( model_name , require_ready = True ) [ソース] 与えられた model_name を持つ Model を返します。 model_name は大文字小文字を区別しません。 このアプ ... リケーションにそのようなモデルが存在しない場合、 LookupError を発生させます。 require_ready 引数が False に設定されていない限り、アプリのレジストリが完全に登録されている必要があります。 require_ready は apps. ... べます。 app_name はアプリのフルネームで、たとえば 'django.contrib.admin' です。 apps. get_model ( app_label , model_name , require_ready = True ) 与えられた app_label と model_name を持つ Model を返します。 ショートカットとして、このメソッドは app_label ... ... 利用可能で、 django/utils/log.py で定義されています。 { "version" : 1 , "disable_existing_loggers" : False , "filters" : { "require_debug_false" : { "()" : "django.utils.log.RequireDebugFalse" , }, "require_debug_true" : { "()" : "django.utils.log.Requir ... at" : "[ {server_time} ] {message} " , "style" : "{" , } }, "handlers" : { "console" : { "level" : "INFO" , "filters" : [ "require_debug_true" ], "class" : "logging.StreamHandler" , }, "django.server" : { "level" : "INFO" , "class" : "logging.StreamHand ... ler" , "formatter" : "django.server" , }, "mail_admins" : { "level" : "ERROR" , "filters" : [ "require_debug_false" ], "class" : "django.utils.log.AdminEmailHandler" , }, }, "loggers" : { "django" : { "handlers" : [ "console" ... ... rectly. This requires Apache version >= 2.2 and mod_wsgi >= 2.0. For example, you could: 認証されたユーザにのみ、静的/メディアファイルを Apache ... e.com WSGIProcessGroup %{GLOBAL} WSGIApplicationGroup %{GLOBAL} <Location "/secret" > AuthType Basic AuthName "Top Secret" Require valid-user AuthBasicProvider wsgi WSGIAuthUserScript /path/to/mysite.com/mysite/wsgi.py </Location> WSGIAuthUserScript ディ ... Provider wsgi WSGIAuthUserScript /path/to/mysite.com/mysite/wsgi.py WSGIAuthGroupScript /path/to/mysite.com/mysite/wsgi.py Require group secret-agents Require valid-user </Location> To support the WSGIAuthGroupScript directive, the same WSGI script mysi ... ... y WSGIPythonHome /path/to/venv WSGIPythonPath /path/to/mysite.com <Directory /path/to/mysite.com/mysite > <Files wsgi.py > Require all granted </Files> </Directory> WSGIScriptAlias の行の最初の部分は、あなたがアプリケーションを提供したいベースとなるURLパ ... lias /media/ /path/to/mysite.com/media/ Alias /static/ /path/to/mysite.com/static/ <Directory /path/to/mysite.com/static > Require all granted </Directory> <Directory /path/to/mysite.com/media > Require all granted </Directory> WSGIScriptAlias / /path/t ... o/mysite.com/mysite/wsgi.py <Directory /path/to/mysite.com/mysite > <Files wsgi.py > Require all granted </Files> </Directory> admin ファイルを配信する django.contrib.staticfiles が INSTALLED_APPS にある場合、 Djang ... ... ironment. If you're not familiar with how to do that, read our contributing tutorial . Next, clone your fork, install some requirements, and run the tests: / $ git clone https://github.com/YourGitHubName/django.git django-repo $ cd django-repo/tests ... $ python -m pip install -e .. $ python -m pip install -r requirements/py3.txt $ ./runtests.py ...\> git clone https://github.com/YourGitHubName/django.git django-repo ...\> cd django-repo ... \tests ...\> py -m pip install -e .. ...\> py -m pip install -r requirements\py3.txt ...\> runtests.py Installing the requirements will likely require some operating system packages that your co ... ... hould be fairly simple and should not require major changes to existing applications. However, we're also releasing 0.96 now because we have a set of backwards-incompat ... make incremental changes to keep up with the development version of Django. 後方互換性のない変更 The following changes may require you to update your code when you switch from 0.95 to 0.96: 要求される MySQLdb バージョン (Django が MySQL データベースに接 ... バージョンを利用しようとした場合は例外が発生します。 If you're currently unable to upgrade your copy of MySQLdb to meet this requirement, a separate, backwards-compatible backend, called "mysql_old", has been added to Django. To use this backend, change t ... ... . 400% browser zoom. Common issues include: Content is cut off or disappears when zoomed. Content that does not inherently require a two-dimensional layout causes scrolling in both directions (vertical and horizontal). Two-dimensional scrolling is accep ... table for content like images, maps, videos, and data tables, which require both dimensions to be usable. Forced-colors mode (for example Windows Contrast Themes). Note that this can be tested via t ... ... lowing would be possible: {% ssi "/var/www/../../etc/passwd" %} In practice this is not a very common problem, as it would require the template author to put the ssi file in a user-controlled variable, but it's possible in principle. ... ... れらを利用したい場合は、代わりに ASGI を使って Django をデプロイする必要があります。 注釈 A fully asynchronous request stack requires async middleware end-to-end. Where a piece of synchronous middleware sits between an ASGI server and an async view, Djang ... ever_cache() no_append_slash() csp_override() csp_report_only_override() csrf_exempt() csrf_protect() ensure_csrf_cookie() requires_csrf_token() sensitive_variables() sensitive_post_parameters() gzip_page() condition() conditional_page() etag() last_mod ... ified() require_http_methods() require_GET() require_POST() require_safe() vary_on_cookie() vary_on_headers() xframe_options_deny() xframe ... 2026年10月08日