Covered more error messages when the setting file won't load in the managerCovered more error messages when the setting file won't load in the manager..

This commit is contained in:
Griatch 2011-10-04 00:17:39 +02:00
parent 2c4af9076d
commit cbcb13feb1

View file

@ -102,24 +102,28 @@ from src.settings_default import *
Welcome to Evennia (version %(version)s)!
We created a fresh settings.py file for you.""" % {'version': VERSION}
# i18n
from django.utils.translation import ugettext as _
#------------------------------------------------------------
# Test the import of the settings file
#------------------------------------------------------------
try:
# i18n
from django.utils.translation import ugettext as _
from game import settings
except Exception:
import traceback
string = "\n" + traceback.format_exc()
string += _("""\n
Error: Couldn't import the file 'settings.py' in the directory
containing %(file)r. There can be two reasons for this:
containing %(file)r. There are usually two reasons for this:
1) You moved your settings.py elsewhere. In that case move it back or
create a link to it from this folder.
2) The settings module is where it's supposed to be, but contains errors.
Review the traceback above to resolve the problem, then try again.
3) If you get errors on finding DJANGO_SETTINGS_MODULE you might have
set up django wrong in some way. If you run a virtual machine, it might be worth
to restart it to see if this resolves the issue. Evennia should not require you
to define any environment variables manually.
""") % {'file': __file__}
print string
sys.exit(1)