How to reset all table contents in django database using or controller?

Sometimes we need to delete or truncate all the database tables in django project from the or controller file.
First of all you need to go to open the and add the following code to your some functions:


Here, the Modelname is your django model Class name in
Then run the application and make sure that the control reach the line where you added the code just now.

Hope it helps..if so please comment 🙂

About the Author

has written 39 stories on this site.

Write a Comment

Gravatars are small images that can show your personality. You can get your gravatar for free today!


Copyright © 2024 Programmer to Programmer- A website for web programming and mobile application programming tutorials.
Wordpress themes