Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating new SQLite database django

Tags:

python

django

web

I had a duplicate sqlite database. I tried deleting the duplicate but instead deleted both. Is there a way I can generate a new database? The data was not especially important.

like image 254
GreatGather Avatar asked May 01 '15 17:05

GreatGather


2 Answers

Install django-extensions which can be used in order to reset the database.

then run

python manage.py reset_db

then

python manage.py migrate

like image 156
Othman Avatar answered Oct 30 '22 17:10

Othman


When you have no database in your project, a simple python manage.py migrate will create a new db.sqlite3 file.

like image 32
El Bachir Avatar answered Oct 30 '22 16:10

El Bachir