Django 1.7 - “No migrations to apply” when run migrate after makemigrations

后端 未结 15 1575
离开以前
离开以前 2020-11-28 20:46

I use Django1.7 with Mezzanine. I create simple profile (according to Mezzanine documentation) stored in separate app \"profiles\":

class RoadmapProfile(mode         


        
15条回答
  •  盖世英雄少女心
    2020-11-28 21:30

    For me, none of the offered solutions worked. It turns out that I was using different settings for migration (manage.py) and running (wsgi.py). Settings defined in manage.py used a local database however a production database was used in wsgi.py settings. Thus a production database was never migrated. Using:

    django-admin migrate
    

    for migration proved to be better as you have to specify the settings used as here.

    • Make sure that when migrating you always use the same database as when running!

提交回复
热议问题