Django Migration is not applying the migration changes

后端 未结 8 688
悲哀的现实
悲哀的现实 2021-02-02 15:41

Using django 1.7.7 I want to use django\'s migration to add or remove a field. so I modified model.py and ran

python manage.py makemigrations myproj
Migrations f         


        
8条回答
  •  北海茫月
    2021-02-02 16:12

    pip install django-extensions
    

    and add this in the install app of settings.py

    INSTALLED_APPS = [
        'django_extensions'
    ]
    

    Then run

    python ./manage.py reset_db
    

    Then run migrations again

    python manage.py makemigrations
    python manage.py migrate
    
    

    Now, run migrations for your installed apps

    python manage.py makemigrations your_app_name
    python manage.py migrtate your_app_name
    
    

    Done! See Your Database...

提交回复
热议问题