#36345: manage.py shouldn't do template rendering in migration-related commands
-----------------------------------+--------------------------------------
     Reporter:  Christophe Pettus  |                     Type:  Bug
       Status:  new                |                Component:  Migrations
      Version:  5.2                |                 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
-----------------------------------+--------------------------------------
 It appears that `manage.py makemigrations` and `manage.py migrate` do some
 kind of template rendering. This can cause problem in a particular
 situation:

 1. The template rendering path make calls to the ORM (for example, setting
 a Jinja2 global variable), and,
 2. That call to the ORM uses one of the models being migrated, and,
 3. The migration is incompatible between the current state on disk and the
 model class.

 The result is that it attempts to do a query with the current state of the
 model class, which fails, because the migration has not been applied yet
 (stack trace on 5.2 attached).
-- 
Ticket URL: <https://code.djangoproject.com/ticket/36345>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/django-updates/010701965c386b62-bed55696-65e1-48e1-b3b2-6b993fbdfb10-000000%40eu-central-1.amazonses.com.

Reply via email to