Files
test-auth/eve_api/api_puller/importer_path.py
2010-02-23 10:16:25 +00:00

16 lines
597 B
Python

import os
import sys
# The path to the folder containing settings.py.
BASE_PATH = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
APPS_PATH = os.path.join(BASE_PATH, 'apps')
def fix_environment():
"""
Callable function to set up all of the Django environmental variables and
pathing for directly executable python modules.
"""
from importer_path import BASE_PATH
# Prepare the environment
sys.path.insert(0, APPS_PATH)
sys.path.insert(0, BASE_PATH)
os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'