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 :: how to make a star in python turtle 
Python :: database default code in settings django 
Python :: download python on wsl 
Python :: install pytorch 
Python :: how to create a list from csv python 
Python :: python 3 pm2 
Python :: choice random word in python from a text file 
Python :: save machine learning model 
Python :: zip list to dictionary python 
Python :: python selenium hover over element 
Python :: folium anaconda 
Python :: import mean absolute error 
Python :: numpy for data science 
Python :: falsy python 
Python :: show image in python 
Python :: how copy and create same conda environment 
Python :: save list pickle 
Python :: tkinter entry default value 
Python :: get directory of file python 
Python :: pretty print pandas dataframe 
Python :: keyerror dislike_count pafy 
Python :: python add zero to string 
Python :: import sklearn linear regression 
Python :: seaborn rotate xlabels 
Python :: how to generate a random number python 
Python :: How do I set Conda to activate the base environment by default? 
Python :: how to receive password using tkinter entry 
Python :: python print to file 
Python :: yield godot 
Python :: pandas fill na with value from another column 
ADD CONTENT
Topic
Content
Source link
Name
2+6 =