Django : Table doesn't exist

前端 未结 8 1702
再見小時候
再見小時候 2020-11-28 07:45

I dropped some table related to an app. and again tried the syncdb command

python manage.py syncdb

It shows error like

dja         


        
8条回答
  •  挽巷
    挽巷 (楼主)
    2020-11-28 08:00

    1. drop tables (you already did),
    2. comment-out the model in model.py,
    3. and ..

    if django version >= 1.7:

    python manage.py makemigrations
    python manage.py migrate --fake
    

    else

    python manage.py schemamigration someapp --auto
    python manage.py migrate someapp --fake
    
    1. comment-in your model in models.py
    2. go to step 3. BUT this time without --fake

提交回复
热议问题