[Django] #35116: Default settings.MIGRATE is missing

23 views
Skip to first unread message

Django

unread,
Jan 15, 2024, 11:02:55 AM1/15/24
to django-...@googlegroups.com
#35116: Default settings.MIGRATE is missing
-----------------------------------------+------------------------
Reporter: Tobias Krönke | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 5.0
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-----------------------------------------+------------------------
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'
}}}

Will create a PR and link it here in a bit.

--
Ticket URL: <https://code.djangoproject.com/ticket/35116>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Jan 15, 2024, 11:09:40 AM1/15/24
to django-...@googlegroups.com
#35116: Default settings.MIGRATE is missing
-------------------------------+--------------------------------------

Reporter: Tobias Krönke | Owner: nobody
Type: Bug | Status: new
Component: Migrations | Version: 5.0
Severity: Normal | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tobias Krönke):

* has_patch: 0 => 1


Old description:

> 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'
> }}}
>
> Will create a PR and link it here in a bit.

New description:

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

--

--
Ticket URL: <https://code.djangoproject.com/ticket/35116#comment:1>

Django

unread,
Jan 15, 2024, 11:14:03 AM1/15/24
to django-...@googlegroups.com
#35116: Default settings.MIGRATE is missing
-------------------------------+--------------------------------------
Reporter: Tobias Krönke | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 5.0
Severity: Normal | Resolution: invalid

Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------
Changes (by Tobias Krönke):

* status: new => closed
* resolution: => invalid


--
Ticket URL: <https://code.djangoproject.com/ticket/35116#comment:2>

Django

unread,
Jan 15, 2024, 11:15:40 AM1/15/24
to django-...@googlegroups.com
#35116: Default settings.MIGRATE is missing
-------------------------------+--------------------------------------
Reporter: Tobias Krönke | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by 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.

--
Ticket URL: <https://code.djangoproject.com/ticket/35116#comment:3>

Django

unread,
Jan 15, 2024, 11:59:11 AM1/15/24
to django-...@googlegroups.com
#35116: Default settings.MIGRATE is missing
-------------------------------+--------------------------------------
Reporter: Tobias Krönke | Owner: nobody
Type: Bug | Status: closed
Component: Migrations | Version: 5.0
Severity: Normal | Resolution: invalid
Keywords: | Triage Stage: Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+--------------------------------------

Comment (by Tobias Krönke):

Replying to [comment:3 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 sub DB test setting.

--
Ticket URL: <https://code.djangoproject.com/ticket/35116#comment:4>

Reply all
Reply to author
Forward
0 new messages