2009-05-13 05:16:55 +01:00
|
|
|
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()
|
|
|
|
|
2009-05-13 05:58:18 +01:00
|
|
|
#Make directories that troggle requires
|
|
|
|
if not os.path.isdir(settings.PHOTOS_ROOT):
|
|
|
|
os.mkdir(settings.PHOTOS_ROOT)
|
|
|
|
|
2009-05-13 05:16:55 +01:00
|
|
|
import parsers.cavetab
|
2009-05-13 05:46:12 +01:00
|
|
|
parsers.cavetab.LoadCaveTab()
|
2009-05-13 05:35:59 +01:00
|
|
|
import parsers.people
|
|
|
|
parsers.people.LoadPersonsExpos()
|
2009-05-13 05:26:14 +01:00
|
|
|
import parsers.logbooks
|
2009-05-13 05:35:59 +01:00
|
|
|
parsers.logbooks.LoadLogbooks()
|
2009-05-13 05:29:13 +01:00
|
|
|
import parsers.survex
|
2009-05-13 05:39:52 +01:00
|
|
|
parsers.survex.LoadAllSurvexBlocks()
|
2009-05-13 05:43:43 +01:00
|
|
|
import parsers.QMs
|
2009-05-13 05:52:59 +01:00
|
|
|
import parsers.surveys
|