Skip to content

Conversation

@tim-schilling
Copy link
Member

Description

There's a reasonable request to avoid having to use migrations (and presumably have access to the models), when the toolbar is configured to not use a database store. This supports that in two ways:

  1. Hack the migrations via settings.MIGRATION_MODULES to avoid the migrations from being discovered
  2. Prevent the models from being loaded by the AppConfig

References: #2234

Checklist:

  • I have added the relevant tests for this change.
  • I have added an item to the Pending section of docs/changes.rst.

Copy link
Member

@matthiask matthiask left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like it!

We still have the option to move the models into a separate app later if this back proves to be problematic.

@tim-schilling tim-schilling merged commit 0b809d5 into main Oct 30, 2025
61 checks passed
@tim-schilling tim-schilling deleted the hide-migrations branch October 30, 2025 19:12
federicobond pushed a commit to federicobond/django-debug-toolbar that referenced this pull request Nov 26, 2025
…django-commons#2236)

* Hide the migrations when not using the database store.

This is a bit of a hack as we're adjusting the project's settings
and it hides all migrations.

* Hide the toolbar's models when the database store isn't used.

* Force the tests to always find the toolbar's migrations.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants