No longer need to distribute a database file. Each user will run their syncdb script and start with a clean slate. Updated installation instructions in README.
This commit is contained in:
parent
eda1753740
commit
0fc89247aa
6 changed files with 56 additions and 10 deletions
20
initial_setup.py
Normal file
20
initial_setup.py
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
from django.contrib.auth.models import User, Group
|
||||
from apps.objects.models import Object
|
||||
import functions_db
|
||||
import functions_general
|
||||
import gameconf
|
||||
|
||||
def handle_setup():
|
||||
# Set the initial user's username on the #1 object.
|
||||
god_user = User.objects.filter(id=1)[0]
|
||||
god_user_obj = Object.objects.filter(id=1)[0]
|
||||
god_user_obj.set_name(god_user.username)
|
||||
|
||||
groups = ("Immortals", "Wizards", "Builders", "Player Helpers")
|
||||
for group in groups:
|
||||
newgroup = Group()
|
||||
newgroup.name = group
|
||||
newgroup.save()
|
||||
|
||||
# We don't want to do initial setup tasks every startup, only the first.
|
||||
gameconf.set_configvalue('game_firstrun', '0')
|
||||
Loading…
Add table
Add a link
Reference in a new issue