forked from expo/troggle
[svn] Moved and improved reset script from the parsers directory
Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8052 by julian @ 11/2/2008 11:14 PM
This commit is contained in:
parent
33fad37eb0
commit
f336d146f3
22
databaseReset.py
Normal file
22
databaseReset.py
Normal file
@ -0,0 +1,22 @@
|
||||
import os
|
||||
import settings
|
||||
os.environ['PYTHONPATH'] = settings.PYTHON_PATH
|
||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
||||
from django.core import management
|
||||
from django.db import connection
|
||||
|
||||
cursor = connection.cursor()
|
||||
cursor.execute("drop database %s" % settings.DATABASE_NAME)
|
||||
cursor.execute("create database %s" % settings.DATABASE_NAME)
|
||||
cursor.execute("ALTER DATABASE %s CHARACTER SET=utf8" % settings.DATABASE_NAME)
|
||||
cursor.execute("USE %s" % settings.DATABASE_NAME)
|
||||
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()
|
||||
|
||||
import parsers.cavetab
|
||||
import parsers.survex
|
||||
#import parsers.logbooks
|
Loading…
Reference in New Issue
Block a user