... n を使用しますが、実行例は全て manage.py もしくは python -m django でも同様に利用可能です。 使い方 ¶ / $ django-admin <command> [ options ] $ manage.py <command> [ options ] $ python -m django <command> [ options ] ...\> django-admin < command > [op ... tions] ...\> manage.py < command > [options] ...\> py -m django < command > [options] command にはこのドキュメントに一覧されたコマンドの1つでなければなりま ... dmin help を実行すると、使用方法の情報と、各アプリケーションが提供するコマンドのリストが表示されます。 django-admin help --commands を実行すると、利用可能な全てのコマンドの一覧が表示されます。 django-admin help <command> を実行すると、与えられたコマンド ... ... rsion is 3.0 or later. The PostGIS 2 CREATE EXTENSION postgis and the SpatiaLite SELECT InitSpatialMetaData initialization commands are now automatically run by migrate . The GDAL interface now supports retrieving properties of raster (image) data file ... l() method to make it more subclass friendly. 管理コマンド ¶ Database connections are now always closed after a management command called from the command line has finished doing its job. Commands from alternate package formats like eggs are now also di ... Meta.unique_together . It is also able to introspect AutoField for MySQL and PostgreSQL databases. When calling management commands with options using call_command() , the option name can match the command line option name (without the initial dashes) o ... ... n を使用しますが、実行例は全て manage.py もしくは python -m django でも同様に利用可能です。 使い方 ¶ / $ django-admin <command> [ options ] $ manage.py <command> [ options ] $ python -m django <command> [ options ] ...\> django-admin < command > [op ... tions] ...\> manage.py < command > [options] ...\> py -m django < command > [options] command にはこのドキュメントに一覧されたコマンドの1つでなければなりま ... dmin help を実行すると、使用方法の情報と、各アプリケーションが提供するコマンドのリストが表示されます。 django-admin help --commands を実行すると、利用可能な全てのコマンドの一覧が表示されます。 django-admin help <command> を実行すると、与えられたコマンド ... ... rsion is 3.0 or later. The PostGIS 2 CREATE EXTENSION postgis and the SpatiaLite SELECT InitSpatialMetaData initialization commands are now automatically run by migrate . The GDAL interface now supports retrieving properties of raster (image) data file ... l() method to make it more subclass friendly. 管理コマンド ¶ Database connections are now always closed after a management command called from the command line has finished doing its job. Commands from alternate package formats like eggs are now also di ... Meta.unique_together . It is also able to introspect AutoField for MySQL and PostgreSQL databases. When calling management commands with options using call_command() , the option name can match the command line option name (without the initial dashes) o ... ... minimizing overall admin media file size. JavaScript tests ¶ Django's JavaScript tests can be run in a browser or from the command line. The tests are located in a top level js_tests directory. テストを書く ¶ Django's JavaScript tests use QUnit . Here i ... the types of assertions supported by QUnit . テストの実行 ¶ The JavaScript tests may be run from a web browser or from the command line. Testing from a web browser ¶ To run the tests from a web browser, open up js_tests/tests.html in your browser. To me ... てください。( js_tests の中ではなく) Open http://localhost:8000/js_tests/tests.html in your web browser. Testing from the command line ¶ To run the tests from the command line, you need to have Node.js installed. After installing Node.js , install the ... ... minimizing overall admin media file size. JavaScript tests ¶ Django's JavaScript tests can be run in a browser or from the command line. The tests are located in a top level js_tests directory. テストを書く ¶ Django's JavaScript tests use QUnit . Here i ... the types of assertions supported by QUnit . テストの実行 ¶ The JavaScript tests may be run from a web browser or from the command line. Testing from a web browser ¶ To run the tests from a web browser, open up js_tests/tests.html in your browser. To me ... てください。( js_tests の中ではなく) Open http://localhost:8000/js_tests/tests.html in your web browser. Testing from the command line ¶ To run the tests from the command line, you need to have Node.js installed. After installing Node.js , install the ... ... as been deprecated and replaced by migrate . Don't worry - calls to syncdb will still work as before. A new makemigrations command provides an easy way to autodetect changes to your models and make migrations for them. django.db.models.signals.pre_syncd ... ble so you can add your own checks for your own apps and libraries. To perform system checks, you use the check management command. This command replaces the older validate management command. New Prefetch object for advanced prefetch_related operations ... e name (e.g. css/styles.55e7cbb9ba48.css ). The staticfiles.json file is created when running the collectstatic management command and should be a less expensive alternative for remote storages such as Amazon S3. See the ManifestStaticFilesStorage docs ... ... ル で作成した polls アプリケーションに独自の closepoll コマンドを追加します。 独自のコマンドを追加するためには、 management/commands ディレクトリをアプリケーションに追加してください。Djangoは、そのディレクトリ内のアンダーバーで始まらないPythonモジュールす ... べてを manage.py コマンドに登録します。例えば: polls/ __init__.py models.py management/ __init__.py commands/ __init__.py _private.py closepoll.py tests.py views.py この例では、 closepoll コマンドは polls アプリケーションを INSTAL ... y モジュールは管理コマンドとして利用できません。 closepoll.py モジュールには一つだけ満たすべき要件があります。それは、 BaseCommand クラスもしくはその サブクラス の一つを継承した Command クラスを定義することです。 スタンドアロンのスクリプト カスタム管理コ ... ... カスタマイズすることで、機能を追加したり、特定のモジュールをプリロードしたりできます。そのためには、 django.core.management.commands.shell.Command のサブクラスを作成し、既存の shell 管理コマンドをオーバーライドする新しい管理コマンドを作成します。詳細につ ... ケーションで利用可能なオブジェクトまたはモジュールのインポートパスのシーケンスを返す必要があります。例えば: polls/management/commands/shell.py ¶ from django.core.management.commands import shell class Command ( shell . Command ): def get_auto_imports ( se ... てください。自動インポートを恒久的に無効にするには、 get_auto_imports() をオーバーライドして None を返すようにします: class Command ( shell . Command ): def get_auto_imports ( self ): return None 目次 カスタム shell コマンドの作り方 自動インポートをカスタ ... ... カスタマイズすることで、機能を追加したり、特定のモジュールをプリロードしたりできます。そのためには、 django.core.management.commands.shell.Command のサブクラスを作成し、既存の shell 管理コマンドをオーバーライドする新しい管理コマンドを作成します。詳細につ ... ケーションで利用可能なオブジェクトまたはモジュールのインポートパスのシーケンスを返す必要があります。例えば: polls/management/commands/shell.py ¶ from django.core.management.commands import shell class Command ( shell . Command ): def get_auto_imports ( se ... てください。自動インポートを恒久的に無効にするには、 get_auto_imports() をオーバーライドして None を返すようにします: class Command ( shell . Command ): def get_auto_imports ( self ): return None 目次 カスタム shell コマンドの作り方 自動インポートをカスタ ... 2026年10月08日