diff --git a/game/src/__init__.py b/game/gamesrc/__init__.py similarity index 100% rename from game/src/__init__.py rename to game/gamesrc/__init__.py diff --git a/game/manage.py b/game/manage.py index 969b6af91a..411452cc27 100755 --- a/game/manage.py +++ b/game/manage.py @@ -1,7 +1,13 @@ #!/usr/bin/env python +import sys +import os 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__)))) + try: - import settings # Assumed to be in the same directory. + from game import settings except ImportError: import sys sys.stderr.write("Error: Can't find the file 'settings.py' in the directory containing %r. It appears you've customized things.\nYou'll have to run django-admin.py, passing it your settings module.\n(If the file settings.py does indeed exist, it's causing an ImportError somehow.)\n" % __file__) diff --git a/src/cmdhandler.py b/src/cmdhandler.py index 782fbbc914..14814b4976 100755 --- a/src/cmdhandler.py +++ b/src/cmdhandler.py @@ -6,7 +6,7 @@ something. from traceback import format_exc import time -from apps.objects.models import Object +from src.objects.models import Object import defines_global import cmdtable import logger diff --git a/src/commands/general.py b/src/commands/general.py index 2b9413f09e..d92f2790ae 100644 --- a/src/commands/general.py +++ b/src/commands/general.py @@ -6,9 +6,9 @@ import time from django.conf import settings -from apps.config.models import ConfigValue -from apps.helpsys.models import HelpEntry -from apps.objects.models import Object +from src.config.models import ConfigValue +from src.helpsys.models import HelpEntry +from src.objects.models import Object from src import defines_global from src import session_mgr from src import ansi diff --git a/src/commands/info.py b/src/commands/info.py index fe1084c010..ad1427fe78 100644 --- a/src/commands/info.py +++ b/src/commands/info.py @@ -13,7 +13,7 @@ if not functions_general.host_os_is('nt'): import django -from apps.objects.models import Object +from src.objects.models import Object from src import scheduler from src import defines_global from src import flags diff --git a/src/commands/objmanip.py b/src/commands/objmanip.py index cf300629e3..beb4e81044 100644 --- a/src/commands/objmanip.py +++ b/src/commands/objmanip.py @@ -1,7 +1,7 @@ """ These commands typically are to do with building or modifying Objects. """ -from apps.objects.models import Object, Attribute +from src.objects.models import Object, Attribute # We'll import this as the full path to avoid local variable clashes. import src.flags from src import ansi diff --git a/src/commands/paging.py b/src/commands/paging.py index 1699216bd7..084d51adcd 100644 --- a/src/commands/paging.py +++ b/src/commands/paging.py @@ -1,7 +1,7 @@ """ Paging command and support functions. """ -from apps.objects.models import Object +from src.objects.models import Object from src import defines_global def get_last_paged_objects(pobject): diff --git a/src/commands/privileged.py b/src/commands/privileged.py index 40b61b2785..105db73d5a 100644 --- a/src/commands/privileged.py +++ b/src/commands/privileged.py @@ -2,7 +2,7 @@ This file contains commands that require special permissions to use. These are generally @-prefixed commands, but there are exceptions. """ -from apps.objects.models import Object +from src.objects.models import Object from src import defines_global from src import ansi from src import session_mgr diff --git a/src/commands/unloggedin.py b/src/commands/unloggedin.py index 857cbca1d3..15d132ddb9 100644 --- a/src/commands/unloggedin.py +++ b/src/commands/unloggedin.py @@ -3,7 +3,7 @@ Commands that are available from the connect screen. """ from django.contrib.auth.models import User -from apps.objects.models import Attribute, Object +from src.objects.models import Attribute, Object from src import defines_global from src.util import functions_general diff --git a/src/comsys.py b/src/comsys.py index 9a6cfa9d00..c9a382492d 100644 --- a/src/comsys.py +++ b/src/comsys.py @@ -6,7 +6,7 @@ import datetime from django.utils import simplejson -from apps.objects.models import CommChannel, CommChannelMessage +from src.objects.models import CommChannel, CommChannelMessage from src import session_mgr from src import ansi diff --git a/src/config/models.py b/src/config/models.py index deb7c15af0..937bd0c8e5 100755 --- a/src/config/models.py +++ b/src/config/models.py @@ -1,8 +1,8 @@ from django.db import models from django.contrib import admin -from apps.config.managers.commandalias import CommandAliasManager -from apps.config.managers.configvalue import ConfigValueManager -from apps.config.managers.connectscreen import ConnectScreenManager +from src.config.managers.commandalias import CommandAliasManager +from src.config.managers.configvalue import ConfigValueManager +from src.config.managers.connectscreen import ConnectScreenManager class CommandAlias(models.Model): """ diff --git a/src/config_defaults.py b/src/config_defaults.py index 9e610468d4..125f7db627 100644 --- a/src/config_defaults.py +++ b/src/config_defaults.py @@ -28,7 +28,7 @@ ADMINS = ( MANAGERS = ADMINS # The path that contains this settings.py file (no trailing slash). -BASE_PATH = os.path.join(os.path.abspath(os.path.split(__file__)[0]), '..') +BASE_PATH = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) # Path to the game directory (containing the database file if using sqlite). GAME_DIR = os.path.join(BASE_PATH, 'game') @@ -95,7 +95,7 @@ SERVE_MEDIA = True # The master urlconf file that contains all of the sub-branches to the # applications. -ROOT_URLCONF = 'urls' +ROOT_URLCONF = 'game.web.urls' # Where users are redirected after logging in via contribu.auth.login. LOGIN_REDIRECT_URL = '/' @@ -156,7 +156,7 @@ TEMPLATE_CONTEXT_PROCESSORS = ( 'django.core.context_processors.auth', 'django.core.context_processors.media', 'django.core.context_processors.debug', - 'webapps.website.webcontext.general_context', + 'game.web.apps.website.webcontext.general_context', ) # Global and Evennia-specific apps. This ties everything together so we can @@ -168,12 +168,12 @@ INSTALLED_APPS = ( 'django.contrib.sessions', 'django.contrib.admin', 'django.contrib.flatpages', - 'apps.config', - 'apps.objects', - 'apps.helpsys', - 'apps.genperms', - 'webapps.news', - 'webapps.website', + 'src.config', + 'src.objects', + 'src.helpsys', + 'src.genperms', + #'webapps.news', + #'webapps.website', ) # If django_extensions is present, import it and install it. Otherwise fail diff --git a/src/helpsys/models.py b/src/helpsys/models.py index 015d5ae4fe..dc66184438 100644 --- a/src/helpsys/models.py +++ b/src/helpsys/models.py @@ -4,7 +4,7 @@ Models for the help system. from django.db import models from django.contrib import admin from src import ansi -from apps.helpsys.managers.helpentry import HelpEntryManager +from src.helpsys.managers.helpentry import HelpEntryManager class HelpEntry(models.Model): """ diff --git a/src/initial_setup.py b/src/initial_setup.py index db88b280a6..948130bd8b 100644 --- a/src/initial_setup.py +++ b/src/initial_setup.py @@ -1,6 +1,6 @@ from django.contrib.auth.models import User, Group -from apps.objects.models import Object -from apps.config.models import ConfigValue +from src.objects.models import Object +from src.config.models import ConfigValue def handle_setup(): # Set the initial user's username on the #1 object. diff --git a/src/objects/managers/object.py b/src/objects/managers/object.py index 548c4004bf..e2fceed334 100644 --- a/src/objects/managers/object.py +++ b/src/objects/managers/object.py @@ -10,9 +10,9 @@ from django.contrib.auth.models import User from django.db.models import Q from django.contrib.contenttypes.models import ContentType -from apps.config.models import ConfigValue -from apps.objects.exceptions import ObjectNotExist -from apps.objects.util import object as util_object +from src.config.models import ConfigValue +from src.objects.exceptions import ObjectNotExist +from src.objects.util import object as util_object from src import defines_global class ObjectManager(models.Manager): diff --git a/src/objects/models.py b/src/objects/models.py index b5ca789a89..18055f5eea 100755 --- a/src/objects/models.py +++ b/src/objects/models.py @@ -2,11 +2,11 @@ import re from django.db import models from django.contrib.auth.models import User, Group from django.contrib import admin -from apps.config.models import ConfigValue -from apps.objects.util import object as util_object -from apps.objects.managers.commchannel import CommChannelManager -from apps.objects.managers.object import ObjectManager -from apps.objects.managers.attribute import AttributeManager +from src.config.models import ConfigValue +from src.objects.util import object as util_object +from src.objects.managers.commchannel import CommChannelManager +from src.objects.managers.object import ObjectManager +from src.objects.managers.attribute import AttributeManager from src import scripthandler from src import defines_global from src import ansi diff --git a/src/server.py b/src/server.py index fb3de389f2..db30732bfe 100755 --- a/src/server.py +++ b/src/server.py @@ -9,7 +9,7 @@ from django.db import models from django.db import connection from django.conf import settings -from apps.config.models import CommandAlias, ConfigValue +from src.config.models import CommandAlias, ConfigValue from src.session import SessionProtocol from src import scheduler from src import logger diff --git a/src/session.py b/src/session.py index 7220546048..cd345067c5 100755 --- a/src/session.py +++ b/src/session.py @@ -10,8 +10,8 @@ from twisted.conch.telnet import StatefulTelnetProtocol from django.contrib.auth.models import User -from apps.objects.models import Object -from apps.config.models import ConnectScreen, ConfigValue +from src.objects.models import Object +from src.config.models import ConnectScreen, ConfigValue import cmdhandler import logger import session_mgr diff --git a/src/session_mgr.py b/src/session_mgr.py index f892e48181..5640b62b47 100644 --- a/src/session_mgr.py +++ b/src/session_mgr.py @@ -3,7 +3,7 @@ Session manager, handles connected players. """ import time -from apps.config.models import ConfigValue +from src.config.models import ConfigValue from src import logger from src.util import functions_general