4 examples of 'django reset database' in Python

Every line of 'django reset database' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your Python code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
37@manager.command
38def resetdb():
39 """Remove all content from database and creates new tables"""
40 conn = Connection(app_site())
41 conn.get('reset')
42 print 'Database reset'
22def reset_db():
23 if confirm("Are you sure? This will WIPE ALL USER DATA"):
24 with cd(code_dir):
25 run("redis-cli flushall")
26 run("make seed")
45def reset_db():
46 init_db()
47
48 for model in REGISTERED_MODELS:
49 model.drop_table(True)
50 model.create_table(True)
271def _destroy_test_db(self, test_database_name, verbosity):
272 """
273 Internal implementation - remove the test db tables.
274 """
275 # Remove the test database to clean up after
276 # ourselves. Connect to the previous database (not the test database)
277 # to do so, because it's not allowed to delete a database while being
278 # connected to it.
279 with self.connection._nodb_connection.cursor() as cursor:
280 # Wait to avoid "database is being accessed by other users" errors.
281 time.sleep(1)
282 cursor.execute("DROP DATABASE %s"
283 % self.connection.ops.quote_name(test_database_name))

Related snippets