How can I drop all tables from a database using manage.py and command line? Is there any way to do that executing manage.py with appropriate parameters so I can execute it f
Using Python to make a flushproject command, you use :
from django.db import connection cursor = connection.cursor() cursor.execute(“DROP DATABASE %s;”, [connection.settings_dict['NAME']]) cursor.execute(“CREATE DATABASE %s;”, [connection.settings_dict['NAME']])