|
|
@ -6,14 +6,6 @@ import sys |
|
|
|
import datetime |
|
|
|
import datetime |
|
|
|
import argparse |
|
|
|
import argparse |
|
|
|
import logging |
|
|
|
import logging |
|
|
|
|
|
|
|
|
|
|
|
# django setup |
|
|
|
|
|
|
|
DJANGO_SETTINGS_MODULE = 'settings' |
|
|
|
|
|
|
|
DJANGO_PROJECT_PATH = os.path.dirname(sys.argv[0]) + '/web' |
|
|
|
|
|
|
|
sys.path.insert(1, DJANGO_PROJECT_PATH) |
|
|
|
|
|
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE |
|
|
|
|
|
|
|
from web.postkey.models import i2phost |
|
|
|
|
|
|
|
from web.lib.utils import get_logger |
|
|
|
|
|
|
|
import configobj |
|
|
|
import configobj |
|
|
|
|
|
|
|
|
|
|
|
# parse command line options |
|
|
|
# parse command line options |
|
|
@ -32,7 +24,16 @@ if 'include' in config: |
|
|
|
config_included = configobj.ConfigObj(config['include']) |
|
|
|
config_included = configobj.ConfigObj(config['include']) |
|
|
|
config.merge(config_included) |
|
|
|
config.merge(config_included) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# django setup |
|
|
|
|
|
|
|
DJANGO_SETTINGS_MODULE = 'settings' |
|
|
|
|
|
|
|
if 'DJANGO_PROJECT_PATH' in config: |
|
|
|
|
|
|
|
DJANGO_PROJECT_PATH = config['DJANGO_PROJECT_PATH'] |
|
|
|
else: |
|
|
|
else: |
|
|
|
|
|
|
|
DJANGO_PROJECT_PATH = os.path.dirname(sys.argv[0]) + '/web' |
|
|
|
|
|
|
|
sys.path.insert(1, DJANGO_PROJECT_PATH) |
|
|
|
|
|
|
|
os.environ['DJANGO_SETTINGS_MODULE'] = DJANGO_SETTINGS_MODULE |
|
|
|
|
|
|
|
from web.postkey.models import i2phost |
|
|
|
|
|
|
|
from web.lib.utils import get_logger |
|
|
|
|
|
|
|
|
|
|
|
# configure logger |
|
|
|
# configure logger |
|
|
|
if args.debug == True: |
|
|
|
if args.debug == True: |
|
|
|