Fix django path finding for bin/ scripts

This commit is contained in:
Sebastian Lohff 2017-04-07 15:07:52 +02:00
parent f10c9433c0
commit c0a65be9d0
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,8 @@ import django
import ipaddress import ipaddress
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dnmgmt.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dnmgmt.settings")
sys.path.append("..") BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
django.setup() django.setup()

View File

@ -10,7 +10,8 @@ import logging
import select import select
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dnmgmt.settings") os.environ.setdefault("DJANGO_SETTINGS_MODULE", "dnmgmt.settings")
sys.path.append("..") BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(BASE_DIR)
django.setup() django.setup()
from whoisdb.helpers import findInDatabase, getWhoisObjectFields from whoisdb.helpers import findInDatabase, getWhoisObjectFields