... go インストールで複数のサイトを運用し、これらのサイトを何らかの方法で区別する必要がある場合に使用します。 sites フレームワークは、主にこのモデルに基づいています: class models. Site ウェブサイトの domain と name 属性を格納するモデル。 ... これをどのように使用するかはあなた次第ですが、Djangoはいくつかの慣習を通じて自動的にいくつかの方法で使用します。 使用例 なぜ sites を使うのでしょうか? それは例を挙げるとわかりやすいでしょう。 複数のサイトとコンテンツを関連付ける LJWorld.com と Lawrence. ... イトに関連付けられます。Djangoモデルの用語では、これは Article モデル中に ManyToManyField で表されます: from django.contrib.sites.models import Site from django.db import models class Article ( models . Model ): headline = models . CharField ( max_leng ... ... ル flatpages アプリをインストールするには、以下の手順に従ってください: もし設定にまだ含まれていない場合は、 'django.contrib.sites' をあなたの INSTALLED_APPS 設定に追加することで sites フレームワーク をインストールしてください。 また、 SITE_ID に設定ファ ... れていることを確認してください。これは通常 1 になります (つまり SITE_ID = 1 になります。ただし、複数のサイトを管理するために sites フレームワークを使用している場合は、別のサイトの ID になる可能性があります) 。 INSTALLED_APPS 設定に 'django.contrib.flatp ... ge.py migrate を実行します。 しくみ manage.py migrate は、データベースに2つのテーブル、 django_flatpage と django_flatpage_sites を作成します。 django_flatpage は、URL をタイトルとテキストコンテンツのまとまりにマッピングするルックアップテーブルです。 ... ... b.humanize メッセージフレームワーク django.contrib.postgres redirects (リダイレクト)アプリ サイトマップ・フレームワーク "sites" フレームワーク staticfiles アプリ 配信 (syndication) フィード フレームワーク admin Djangoの自動管理インターフェースです。 ... ータベース内で「フラットな」HTMLコンテンツを管理するためのフレームワークです。 flatpages のドキュメント を参照してください。 sites contribパッケージのインストールも必要です。 gis Djangoをベースに構築された世界クラスの空間データフレームワークであり、空間 ... してください。 sessions 匿名セッションでデータを保存するためのフレームワーク。 sessions のドキュメント を参照してください。 sites 同じデータベースと Django インストールを利用して複数のウェブサイトを運用できる軽量なフレームワークです。オブジェクトを1つま ... ... ssible for the ConditionalGetMiddleware to handle conditional GET requests for sitemaps which set lastmod . django.contrib.sites The new django.contrib.sites.middleware.CurrentSiteMiddleware allows setting the current site on each request. django.cont ... xists, the deprecation is irrelevant as the entire feature will be removed in Django 1.9. Reorganization of django.contrib.sites django.contrib.sites provides reduced functionality when it isn't in INSTALLED_APPS . The app-loading refactor adds some c ... n. As a consequence, two objects were moved, and the old locations are deprecated: RequestSite now lives in django.contrib.sites.requests . get_current_site() now lives in django.contrib.sites.shortcuts . declared_fieldsets attribute on ModelAdmin Mod ... ... he template for the technical 500 debug page. Given the right circumstances, this allowed a cross-site scripting attack. This vulnerability shouldn't affect most production sites since you shouldn't run with DEBUG = True (whic ... ... ented custom fields inheriting from ManyToManyField from being recognized in migrations ( #24236 ). Fixed crash in contrib.sites migrations when a default database isn't used ( #24332 ). Added the ability to set the isolation level on PostgreSQL with ... ... security : セキュリティ関連の設定をチェックします。 signals : シグナルの宣言とハンドラーの登録に関するチェックを行います。 sites : django.contrib.sites の設定をチェックします。 staticfiles : django.contrib.staticfiles の設定をチェックします。 template ... go.contrib.postgres feature> を使用するために、 'django.contrib.postgres' は INSTALLED_APPS に含まれている必要があります。 sites 以下のチェックは CurrentSiteManager を使用しているモデルに対して行われます: sites.E001 : CurrentSiteManager は <field name ... > というフィールドを見つけられませんでした。 sites.E002 : CurrentSiteManager は、外部キーや多対多のフィールドではないため、 <field> を使用できません。 以下のチェックは、 dja ... ... CSRF_COOKIE_DOMAIN setting CSRF_COOKIE_HTTPONLY setting CSRF_COOKIE_NAME setting CSRF_COOKIE_PATH setting CSRF_COOKIE_SAMESITE setting CSRF_COOKIE_SECURE setting csrf_exempt() (django.views.decorators.csrf モジュール) CSRF_FAILURE_VIEW setting CSRF_H ... のクラス) current_app (HttpRequest の属性) CURRENT_ROW (WindowFrameExclusion の属性) CurrentSiteMiddleware (django.contrib.sites.middleware のクラス) cut template filter cycle template tag cycle_key() (backends.base.SessionBase のメソッド) D D (django ... () built-in function django.conf.urls module django.conf.urls.i18n module django.contrib.admin module django.contrib.admin.sites.all_sites (django.contrib.admin モジュール) django.contrib.admindocs module django.contrib.auth module django.contrib.auth ... ... middleware Session middleware. django.contrib.sitemaps A framework for generating Google sitemap XML files. django.contrib.sites Lets you operate multiple websites from the same database and Django project django.contrib.sites.middleware Site middlewa ... ... から取得されます。 どのように動作するか、例を見てみましょう。すでに contenttypes アプリケーションがインストールされていて、 sites アプリケーション を INSTALLED_APPS 設定に追加し、 manage.py migrate を実行してインストールすると、 django.contrib.sites.mo ... ルがデータベースにインストールされます。それと一緒に ContentType の新しいインスタンスが以下の値で作成されます: app_label は 'sites' (Python のパス django.contrib.sites の最後の部分) に設定されます。 model は 'site' に設定されます。 ContentType インスタン ... 2026年10月08日