mirror of
https://expo.survex.com/repositories/expoweb/.git/
synced 2024-11-23 07:41:56 +00:00
[svn r8043] Add Martin's reset script
This commit is contained in:
parent
8bfa77583e
commit
dfebde5da1
17
troggle/parsers/databaseReset.py
Normal file
17
troggle/parsers/databaseReset.py
Normal file
@ -0,0 +1,17 @@
|
||||
import os
|
||||
os.environ['PYTHONPATH'] = 'c:\djangoprojects\verfification'
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
||||
from django.core import management
|
||||
from django.db import connection
|
||||
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("drop database verification")
|
||||
cursor.execute("create database verification")
|
||||
cursor.execute("use verification")
|
||||
management.call_command('syncdb')
|
||||
from django.contrib.auth.models import User
|
||||
user = User.objects.create_user('m', 'm@m.com', 'm')
|
||||
user.is_staff = True
|
||||
user.is_superuser = True
|
||||
user.save()
|
||||
#management.call_command('runserver')
|
Loading…
Reference in New Issue
Block a user