Reset SQLite database in Django

后端 未结 5 582
孤街浪徒
孤街浪徒 2021-02-01 22:34

I am trying to refactor a Django project. I renamed a couple apps and added a new one, as well as shuffled some models around. I want to clear my database and migrations and sta

5条回答
  •  粉色の甜心
    2021-02-01 23:02

    I had the same issue, using Django 1.10, here is what I did, I deleted the database sqlite file, deleted the pycache folders inside each of the apps, deleted all files inside the migrations folder for each app , except the init.py file, and then ran python manage.py makemigrations and python manage.py migrate. Also note that because you deleted the database you will have to create a new superuser using python manage.py createsuperuser. Hope this helps

提交回复
热议问题