[Answer]-Django – Running a mysql restore via python

1👍

I would recommend you to provide fixtures for all your initial data and provide the user with a view to run syncdb which will reset everything again with your initial data. However I havent tried this myself.

from django.core.management import call_command

def reset_db(request):
     call_command('syncdb', interactive=False)

0👍

This is the command I use to restore my database. Make sure you are on the unix terminal.
mysql -u(username) -p(password) (name of database)

Leave a comment