summaryrefslogtreecommitdiffstats
path: root/databaseReset.py
diff options
context:
space:
mode:
Diffstat (limited to 'databaseReset.py')
-rw-r--r--databaseReset.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/databaseReset.py b/databaseReset.py
index 1eaeb9c..46bb5d1 100644
--- a/databaseReset.py
+++ b/databaseReset.py
@@ -16,7 +16,6 @@ import json
# NOTE databaseRest.py is *imported* by views_other.py as it is used in the control panel
# presented there.
-databasename=settings.DATABASES['default']['NAME']
expouser=settings.EXPOUSER
expouserpass=settings.EXPOUSERPASS
expouseremail=settings.EXPOUSER_EMAIL
@@ -43,7 +42,7 @@ def syncuser():
"""Sync user - needed after reload
"""
print("Synchronizing user")
- management.call_command('syncdb', interactive=False)
+ management.call_command('migrate', interactive=False)
user = User.objects.create_user(expouser, expouseremail, expouserpass)
user.is_staff = True
user.is_superuser = True
@@ -262,7 +261,7 @@ class JobQueue():
self.memdumpsql()
self.saveprofiles()
else:
- django.db.close_old_connections() # needed if MySQL running
+ django.db.close_old_connections() # needed if MySQL running?
# run all the imports through :memory: first
settings.DATABASES['default']['ENGINE'] = 'django.db.backends.sqlite3'
settings.DATABASES['default']['NAME'] = ":memory:"
@@ -287,6 +286,9 @@ class JobQueue():
# the jobque may not start from scratch so we need to initialise the db properly first
# because we are using an empty :memory: database
# But initiating twice crashes, so be sure to do it once only.
+
+
+ # Damn. syncdb() is still calling MySQL somehow **conn_params not sqlite3. So crashes on expo server.
if ("reinit",reinit_db) not in self.queue:
reinit_db()
if ("dirsredirect",dirsredirect) not in self.queue: