Fixed environment setup in ev.py, for launching the api in a normal python interpreter (not manage.py shell)
This commit is contained in:
parent
cc12dc36fa
commit
afb139bc1c
1 changed files with 4 additions and 5 deletions
9
ev.py
9
ev.py
|
|
@ -88,13 +88,12 @@ if __name__ == "__main__":
|
||||||
######################################################################
|
######################################################################
|
||||||
|
|
||||||
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
||||||
from django.conf import settings as settings_full
|
sys.path.insert(1, os.path.dirname(os.path.abspath(__file__)) + os.path.sep + "game")
|
||||||
try:
|
os.environ["DJANGO_SETTINGS_MODULE"] = "game.settings"
|
||||||
settings_full.configure()
|
|
||||||
except RuntimeError:
|
|
||||||
pass
|
|
||||||
del sys, os
|
del sys, os
|
||||||
|
|
||||||
from game import settings
|
from game import settings
|
||||||
|
from django.conf import settings as settings_full
|
||||||
|
|
||||||
try:
|
try:
|
||||||
# test this first import to make sure environment is set up correctly
|
# test this first import to make sure environment is set up correctly
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue