Skip to content

runbolt: run Django system checks and show unapplied-migration warnings like runserver #300

Description

@FarhanAliRaza

Problem

python manage.py runbolt starts the server without the startup output that runserver gives. Django's runserver runs the system check framework and check_migrations() before it serves. It prints:

System check identified no issues (0 silenced).

You have 3 unapplied migration(s). Your project may not work properly until you apply the migrations for app(s): auth, contenttypes, sessions.
Run 'python manage.py migrate' to apply them.

runbolt (python/django_bolt/management/commands/runbolt.py) does not print any of this. BaseCommand.requires_system_checks defaults to __all__, but the command runs checks only when invoked through execute() and never calls check_migrations(). Users get no warning about missing migrations, misconfigured settings, model errors, or security warnings that Django would normally surface at startup.

Expected

runbolt prints the same startup diagnostics as runserver, before it binds the port:

  • system checks (self.check(display_num_errors=True)), including deploy-relevant warnings; errors stop startup like runserver does.
  • unapplied-migration warning (self.check_migrations()).
  • Bolt's own startup checks (route/serializer/middleware compile errors) keep printing as today.

Run once in the parent process, not per worker, so multi-process mode does not repeat the output. In --dev reload mode, re-run the checks after each reload, like runserver autoreload does.

Notes

  • Keep it in the existing banner style (glyphs/colours in runbolt.py), so the checks section reads as part of Bolt's startup output.
  • Add a server_integration test that starts runbolt with an app that has unapplied migrations and asserts the warning is in stdout, and one with a failing system check that asserts startup exits non-zero.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions