Answer the question
In order to leave comments, you need to log in
How to recreate a database for a Django project?
We need to make Django think that the database did not previously exist. So that you can run migrations from the beginning.
How to achieve this?
I deleted the file from the old database. But when I try to create/perform migrations, I get an error pointing to a table from a remote database. How to destroy these connections?
Answer the question
In order to leave comments, you need to log in
Create a new table and register it in the config, and then do the migrations
Delete the migrations folder, drop the database and runpython manage.py migrate --fake-initial
django-extensions
has a reset_db command:
python manage.py reset_db
python manage.py migrate
python manage.py createsuperuser
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question