Big change here is that you now either need to run manage.py (with or without arguments) in order to create your settings.py file when doing initial setup. Or creating it works too.

Also get ready to start separating things out into the new game directory.
This commit is contained in:
Greg Taylor 2008-12-15 04:56:47 +00:00
parent 714804e253
commit 00297d336a
5 changed files with 15 additions and 6 deletions

View file

View file

View file

@ -6,6 +6,16 @@ from django.core.management import execute_manager
# Tack on the root evennia directory to the python path.
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
"""
If settings.py doesn't already exist, create it and populate it with some
basic stuff.
"""
if not os.path.exists('settings.py'):
print "Can't find a settings.py file, creating one for you."
f = open('settings.py', 'w')
f.write('"""\rMaster server configuration file. You may override any of the values in the\rsrc/config_defaults.py here. Copy-paste the variables here, and make changes to\rthis file rather than editing config_defaults.py directly.\r"""\r')
f.write('from src.config_defaults import *')
try:
from game import settings
except ImportError:

View file

@ -1 +0,0 @@
from src.config_defaults import *

View file

@ -35,11 +35,11 @@ GAME_DIR = os.path.join(BASE_PATH, 'game')
# Absolute path to the directory that holds media (no trailing slash).
# Example: "/home/media/media.lawrence.com"
MEDIA_ROOT = '%s/media' % (BASE_PATH)
MEDIA_ROOT = os.path.join(GAME_DIR, 'web', 'media')
# Absolute path to the directory that has the script tree in it. (no trailing slash)
# Example: "/home/evennia/src/scripts"
SCRIPT_ROOT = '%s/src/scripts' % (BASE_PATH)
SCRIPT_ROOT = os.path.join(BASE_PATH, 'src', 'scripts')
# 'postgresql', 'mysql', 'mysql_old', 'sqlite3' or 'ado_mssql'.
DATABASE_ENGINE = 'sqlite3'
@ -128,7 +128,7 @@ TEMPLATE_DIRS = (
# Put strings here, like "/home/html/django_templates" or "C:/www/django/templates".
# Always use forward slashes, even on Windows.
# Don't forget to use absolute paths, not relative paths.
"%s/webtemplates/%s" % (BASE_PATH, ACTIVE_TEMPLATE),
os.path.join(GAME_DIR, "web", "html", ACTIVE_TEMPLATE),
)
# List of callables that know how to import templates from various sources.
@ -172,8 +172,8 @@ INSTALLED_APPS = (
'src.objects',
'src.helpsys',
'src.genperms',
#'webapps.news',
#'webapps.website',
'game.web.apps.news',
'game.web.apps.website',
)
# If django_extensions is present, import it and install it. Otherwise fail