Opened 4 months ago

Closed 4 months ago

Last modified 4 months ago

#35116 closed Bug (invalid)

Default settings.MIGRATE is missing

Reported by: Tobias Krönke Owned by: nobody
Component: Migrations Version: 5.0
Severity: Normal Keywords:
Cc: Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by Tobias Krönke)

Heyo! I hope this is an easy one. For being able to easily skip some tests if migrations are turned off, settings.MIGRATE should actually exist, so we are not forced define it in all of our settings files. Currently, the default does not exist in the settings:

>>> from django.conf import settings
>>> settings.MIGRATION_MODULES
{}
>>> settings.MIGRATE
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    settings.MIGRATE
  File "/var/env/lib/python3.10/site-packages/django/conf/__init__.py", line 104, in __getattr__
    val = getattr(_wrapped, name)
AttributeError: 'Settings' object has no attribute 'MIGRATE'

PR: https://github.com/django/django/pull/17738/files

Change History (4)

comment:1 by Tobias Krönke, 4 months ago

Description: modified (diff)
Has patch: set

comment:2 by Tobias Krönke, 4 months ago

Resolution: invalid
Status: newclosed

comment:3 by Mariusz Felisiak, 4 months ago

I'm not sure what do you want to achieve, but Django doesn't use MIGRATE setting. If you need it you can define it in your project.

in reply to:  3 comment:4 by Tobias Krönke, 4 months ago

Replying to Mariusz Felisiak:

I'm not sure what do you want to achieve, but Django doesn't use MIGRATE setting. If you need it you can define it in your project.

Yes, thx and sorry. I misread the docs and had thought MIGRATE was a global setting, but it's actually a sub DB test setting.

Last edited 4 months ago by Tobias Krönke (previous) (diff)
Note: See TracTickets for help on using tickets.
Back to Top