... lls/management/commands/closepoll.py を以下のように編集してください: from django.core.management.base import BaseCommand , CommandError from polls.models import Question as Poll class Command ( BaseCommand ): help = "Closes the specified poll for voting" def ... r poll_id in options [ "poll_ids" ]: try : poll = Poll . objects . get ( pk = poll_id ) except Poll . DoesNotExist : raise CommandError ( 'Poll " %s " does not exist' % poll_id ) poll . opened = False poll . save () self . stdout . write ( self . style . SUC ... を受け取り、それぞれに対応した poll.opened を False にセットします。もしコマンドの利用者が存在しない poll を指定した場合、 CommandError 例外が発生します。 poll.opened 属性は元の チュートリアル には存在しないので、この例では polls.models.Question モデルに追加 ... ... は現在のプロジェクトの settings.py を使用するからです。 使用例: django-admin migrate --settings=mysite.settings --traceback CommandError が発生した場合、完全なスタックトレースを表示します。デフォルトでは、 django-admin は CommandError が発生するとエラーメッセ ... ... nds do not raise SystemExit any more when called by code from call_command() . Any exception raised by the command (mostly CommandError ) is propagated. Moreover, when you output errors or messages in your custom commands, you should now use self.stdout.writ ... ... tion makes the command exit with a non-zero status when unapplied migrations are detected. The new returncode argument for CommandError allows customizing the exit status for management commands. The new dbshell -- ARGUMENTS option allows passing extra argum ... ... idation in BaseCommand.execute(**options) is removed. Use skip_checks (added in Django 1.7) instead. loaddata now raises a CommandError instead of showing a warning when the specified fixture file is not found. Instead of directly accessing the LogEntry.chan ... ... ns on how to manually delete objects from deleted forms. Loading empty fixtures emits a RuntimeWarning rather than raising CommandError . django.contrib.staticfiles.views.serve() will now raise an Http404 exception instead of ImproperlyConfigured when DEBUG ... ... put -c -i -l -n color_interp() (GDALBand のメソッド) ColorInput (django.forms のクラス) ComboField (django.forms のクラス) CommandError comment template tag commit() (django.db.transaction モジュール) Common Vulnerabilities and Exposures CVE 2007-0404 CVE 20 ... 2026年10月08日