﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
24648	Model fields that reference settings that differ between dev and prod trigger the autodetector	Christophe Pettus	nobody	"If a model has an attribute whose value changes from development to deployment due to a runtime dependency, this can cause migrations to think the code has changed. (Whether it has or not is a philosophical question, I suppose, but it's not a different set of text.)

Example:

In settings.py:
{{{
UPLOAD_ROOT = os.path.normpath(os.path.join(PROJECT_DIR, '..', '..', 'uploads'))
UPLOAD_URL = '/content/'
}}}
In the model:
{{{
upload_storage = FileSystemStorage(location=UPLOAD_ROOT, base_url=UPLOAD_URL)

...

class Thingie(models.Model):
    image = models.ImageField(upload_to='/%Y/%m/%d', storage=upload_storage, null=True, default=None)
}}}
The migrations will consider Thingie to have changed from dev to deployment based on the change of 'upload_storage'.
"	Cleanup/optimization	new	Migrations	1.8	Normal			Andrew Godwin Markus Holtermann ben@… Alex	Accepted	0	0	0	0	0	0
