From 19d94ff516c18d7d5a0b54e0ab1abc976b0d3d9c Mon Sep 17 00:00:00 2001 From: zakhy <=> Date: Thu, 27 Feb 2025 10:21:20 +0700 Subject: [PATCH] fix path --- apps/workerslocation/commands/radiusip.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/workerslocation/commands/radiusip.py b/apps/workerslocation/commands/radiusip.py index cfc89c9..c29bc8f 100644 --- a/apps/workerslocation/commands/radiusip.py +++ b/apps/workerslocation/commands/radiusip.py @@ -4,6 +4,7 @@ import os import socket import struct import subprocess +import sys import time import django @@ -266,6 +267,10 @@ async def main(): if __name__ == "__main__": + project_root = os.path.abspath( + os.path.join(os.path.dirname(__file__), '../../../')) + sys.path.append(project_root) + os.environ.setdefault("DJANGO_SETTINGS_MODULE", "mfssogr.settings") django.setup()