... 上の相対パスを検索します。 例: / $ python manage.py findstatic css/base.css admin/js/core.js Found 'css/base.css' here: /home/special.polls.com/core/static/css/base.css /home/polls.com/core/static/css/base.css Found 'admin/js/core.js' here: /home/p ... ngo/contrib/admin/media/js/core.js ...\> py manage.py findstatic css\base.css admin\js\core.js Found 'css/base.css' here: /home/special.polls.com/core/static/css/base.css /home/polls.com/core/static/css/base.css Found 'admin/js/core.js' here: /home/p ... -first オプションを使用してください。 / $ python manage.py findstatic css/base.css --first Found 'css/base.css' here: /home/special.polls.com/core/static/css/base.css ...\> py manage.py findstatic css\base.css --first Found 'css/base.css' here: / ... ... 設定は次のようになっています。 TEMPLATES = [ { "BACKEND" : "django.template.backends.django.DjangoTemplates" , "DIRS" : [ "/home/html/example.com" , "/home/html/default" , ], }, { "BACKEND" : "django.template.backends.jinja2.Jinja2" , "DIRS" : [ "/hom ... e/html/jinja2" , ], }, ] get_template('story_detail.html') を呼び出した場合、Django は次の順番にファイルを探します。 /home/html/example.com/story_detail.html ( 'django' エンジン) /home/html/default/story_detail.html ( 'django' エンジン) /home/ht ... elect_template(['story_253_detail.html', 'story_detail.html']) を呼び出した場合、Djangoは以下の順番にファイルを探します。 /home/html/example.com/story_253_detail.html ( 'django' エンジン) /home/html/default/story_253_detail.html ( 'django' エンジン) ... ... 0 seconds --max-requests = 5000 \ # respawn processes after serving 5000 requests --vacuum \ # clear environment on exit --home = /path/to/virtual/env \ # optional path to a virtual environment --daemonize = /var/log/uwsgi/yourproject.log # backgroun ... tartproject によって生成される mysite.wsgi モジュールです。 env : 少なくとも DJANGO_SETTINGS_MODULE を含む必要があります。 home : プロジェクトの仮想環境へのパスを指定します。 ini 設定ファイルの例: [uwsgi] chdir = /path/to/your/project module = mysite ... ... するようになりました。これにより、ヘッダーを宣言するためのより自然な構文が可能になります。 # Before: self . client . get ( "/home/" , HTTP_ACCEPT_LANGUAGE = "fr" ) await self . async_client . get ( "/home/" , ACCEPT_LANGUAGE = "fr" ) # After: self . cl ... ient . get ( "/home/" , headers = { "accept-language" : "fr" }) await self . async_client . get ( "/home/" , headers = { "accept-language" : " ... ... entication factors, not TOTP (one-time codes). Create an API token following the official documentation , and set up your $HOME/.pypirc file like this: ~/.pypirc [distutils] index-servers = pypi django [pypi] username = __token__ password = # User-sc ... to Django's project on Transifex , with a Manager role. Generate an API Token in the user setting section and set up your $HOME/.transifexrc file like this: ~/.transifexrc [https://www.transifex.com] rest_hostname = https://rest.api.transifex.com tok ... example pre-release announcement . A few days before a feature freeze In preparation for the alpha release, the directory /home/www/www/media/releases/A.B must be created on the djangoproject server. Before the feature freeze, a branch targeting main ... ... ing may be added to your Django settings file with the full path to the GEOS C library. For example: GEOS_LIBRARY_PATH = '/home/bob/local/lib/libgeos_c.so' 注釈 設定は C 共有ライブラリの フル パスである必要があります。つまり、 libgeos.so ではなく lib ... tting may be added to your Django settings file with the full path to the GDAL library. For example: GDAL_LIBRARY_PATH = '/home/sue/local/lib/libgdal.so' 脚注 [ 1 ] The datum shifting files are needed for converting data to and from certain projectio ... ... ext_data() Example views.py : from django.views.generic.base import TemplateView from articles.models import Article class HomePageView ( TemplateView ): template_name = "home.html" def get_context_data ( self , ** kwargs ): context = super () . get_ ... ] = Article . objects . 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 を通じて) ビ ... ... hot という名前の場合、 {{ object.mug_shot.url }} でテンプレート内の画像の絶対パスを取得できます。 例えば、 MEDIA_ROOT が '/home/media' に設定され、 upload_to が 'photos/%Y/%m/%d' に設定されているとします。 upload_to の '%Y/%m/%d' の部分は strftime() ... フォーマットです。 '%Y' は4桁の年、 '%m' は2桁の月、 '%d' は2桁の日です。2007年1月15日にファイルをアップロードすると、 /home/media/photos/2007/01/15 というディレクトリに保存されます。 アップロードされたファイルのディスク上のファイル名やファイルサイ ... : FilePathField. path 必須です。 FilePathField が選択肢から取得するディレクトリへの、ファイルシステムの絶対パスです。例: "/home/images" 。 path には呼び出し可能オブジェクトを指定することもでき、これは例えば実行時に動的にパスを設定する関数などです。例 ... ... なり、 Python 関数の引数は 1 つになります--タグが呼び出された時点のテンプレートコンテキストです。 例えば、メインページを指す home_link と home_title 変数を含むコンテキストの中で常に使用される inclusion tag を書くとします。Python の関数は次のようになりま ... : @register . inclusion_tag ( "link.html" , takes_context = True ) def jump_link ( context ): return { "link" : context [ "home_link" ], "title" : context [ "home_title" ], } 最初の引数は context に しなければならない ことに注意してください。 この re ... ... : ファイル内の空間データに対応する GEOSGeometry 例: >>> from django.contrib.gis.geos import fromfile >>> g = fromfile ( "/home/bob/geom.wkt" ) fromstr ( string , srid = None ) [ソース] パラメータ : string ( str ) -- 空間データを含む文字列 srid ( int ... on of the GEOS C library. Typically, this setting is only used if the GEOS C library is in a non-standard location (e.g., /home/bob/lib/libgeos_c.so ). 注釈 設定は C 共有ライブラリの フル パスである必要があります。つまり、 libgeos.so ではなく libgeos ... 2026年10月08日