mirror of
https://github.com/nikdoof/test-auth.git
synced 2025-12-14 23:02:19 +00:00
16 lines
597 B
Python
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' |