Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

django reset database

python manage.py flush
Comment

reset django database

WARNING! You will loose everything that was in the database!
1/ Delete everything in:
	- migrations
    - __pycache__
2/ Delete the database
	- db.sqlite3
3/ Run, in this order:
	- python3 manage.py makemigrations
    - python3 manage.py migrate --run-syncdb

(OPTIONAL)
Run "python3 manage.py makesuperuser", you deleted the previous one!

Tested only with sqlite, not the best choice if you are in production.
Comment

PREVIOUS NEXT
Code Example
Python :: binary to decimal in python 
Python :: python version command 
Python :: videofield django 
Python :: python get address of object 
Python :: how to create a countdown timer using python 
Python :: pytest check exception 
Python :: list to sentence python 
Python :: convert list to string 
Python :: how to plot corilation python 
Python :: filter list of tuples python 
Python :: find record where dataframe column value contains 
Python :: drop missing values in a column pandas 
Python :: python sqlite insert 
Python :: print str and float python 
Python :: what is pypy 
Python :: subprocess print logs 
Python :: python open file 
Python :: python remove all unicode from string 
Python :: python execute shell command and get output 
Python :: make binary tree in python 
Python :: pandas convert series of datetime to date 
Python :: python 2d array to dataframe 
Python :: pandas difference between dates 
Python :: boto3 paginate 
Python :: python dictionary comprehension 
Python :: python tabulate float format 
Python :: increase colorbar ticksize 
Python :: python get value from decimal object 
Python :: df only take 2 columns 
Python :: images in django 
ADD CONTENT
Topic
Content
Source link
Name
7+7 =