Fixed environment setup in ev.py, for launching the api in a normal python interpreter (not manage.py shell)

This commit is contained in:
Griatch 2013-05-15 23:57:50 +02:00
parent cc12dc36fa
commit afb139bc1c

9
ev.py
View file

@ -88,13 +88,12 @@ if __name__ == "__main__":
######################################################################
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
from django.conf import settings as settings_full
try:
settings_full.configure()
except RuntimeError:
pass
sys.path.insert(1, os.path.dirname(os.path.abspath(__file__)) + os.path.sep + "game")
os.environ["DJANGO_SETTINGS_MODULE"] = "game.settings"
del sys, os
from game import settings
from django.conf import settings as settings_full
try:
# test this first import to make sure environment is set up correctly