Added a superuser creation call to evennia.py to replace the automatic one that
was done by syncdb before.
This commit is contained in:
parent
a4042920e0
commit
607674c6cf
2 changed files with 7 additions and 5 deletions
|
|
@ -129,11 +129,9 @@ PORTAL_LOGFILE = settings.PORTAL_LOG_FILE
|
||||||
|
|
||||||
# Check so a database exists and is accessible
|
# Check so a database exists and is accessible
|
||||||
from django.db import DatabaseError
|
from django.db import DatabaseError
|
||||||
from src.objects.models import ObjectDB
|
from src.players.models import PlayerDB
|
||||||
try:
|
try:
|
||||||
test = ObjectDB.objects.get(id=1)
|
superuser = PlayerDB.objects.get(id=1)
|
||||||
except ObjectDB.DoesNotExist:
|
|
||||||
pass # this is fine at this point
|
|
||||||
except DatabaseError,e:
|
except DatabaseError,e:
|
||||||
print """
|
print """
|
||||||
Your database does not seem to be set up correctly.
|
Your database does not seem to be set up correctly.
|
||||||
|
|
@ -147,6 +145,11 @@ except DatabaseError,e:
|
||||||
When you have a database set up, rerun evennia.py.
|
When you have a database set up, rerun evennia.py.
|
||||||
""" % e
|
""" % e
|
||||||
sys.exit()
|
sys.exit()
|
||||||
|
except PlayerDB.DoesNotExist:
|
||||||
|
# no superuser yet. We need to create it.
|
||||||
|
from django.core.management import call_command
|
||||||
|
print "Create a superuser below. The superuser is Player #1, the 'owner' account of the server."
|
||||||
|
call_command("createsuperuser", interactive=True)
|
||||||
|
|
||||||
# Add this to the environmental variable for the 'twistd' command.
|
# Add this to the environmental variable for the 'twistd' command.
|
||||||
currpath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
currpath = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ Everything starts at handle_setup()
|
||||||
import django
|
import django
|
||||||
from django.core import management
|
from django.core import management
|
||||||
from django.conf import settings
|
from django.conf import settings
|
||||||
from django.core.management import call_command
|
|
||||||
from django.contrib.auth import get_user_model
|
from django.contrib.auth import get_user_model
|
||||||
from src.server.models import ServerConfig
|
from src.server.models import ServerConfig
|
||||||
from src.help.models import HelpEntry
|
from src.help.models import HelpEntry
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue