mirror of
https://expo.survex.com/repositories/troggle/.git
synced 2024-11-25 08:41:51 +00:00
django.setup needs to be run before any attempt to use database
This commit is contained in:
parent
89ef5c19ff
commit
10a05d686e
@ -2,12 +2,12 @@ import os
|
|||||||
import time
|
import time
|
||||||
import settings
|
import settings
|
||||||
os.environ['PYTHONPATH'] = settings.PYTHON_PATH
|
os.environ['PYTHONPATH'] = settings.PYTHON_PATH
|
||||||
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
|
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'settings')
|
||||||
from django.core import management
|
from django.core import management
|
||||||
from django.db import connection
|
from django.db import connection
|
||||||
from django.contrib.auth.models import User
|
from django.contrib.auth.models import User
|
||||||
from django.http import HttpResponse
|
from django.http import HttpResponse
|
||||||
from django.core.urlresolvers import reverse
|
from django.core.urlresolvers import reverse
|
||||||
from troggle.core.models import Cave, Entrance
|
from troggle.core.models import Cave, Entrance
|
||||||
import troggle.flatpages.models
|
import troggle.flatpages.models
|
||||||
|
|
||||||
@ -187,6 +187,8 @@ def usage():
|
|||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
import troggle.core.models
|
import troggle.core.models
|
||||||
import sys
|
import sys
|
||||||
|
import django
|
||||||
|
django.setup()
|
||||||
if "desc" in sys.argv:
|
if "desc" in sys.argv:
|
||||||
resetdesc()
|
resetdesc()
|
||||||
elif "scans" in sys.argv:
|
elif "scans" in sys.argv:
|
||||||
|
Loading…
Reference in New Issue
Block a user