diff --git a/run.py b/run.py index ff91e52..3ba2066 100644 --- a/run.py +++ b/run.py @@ -7,8 +7,11 @@ os.system("python manage.py makemigrations") os.system("python manage.py migrate") +ip = "0." * 4 + if platform.system() != "Linux": - os.system("python manage.py runserver") + os.system("python manage.py runserver") else: - os.system("python manage.py runserver 0.0.0.0:8000 > log.txt & \n") - print("The backend is running!") \ No newline at end of file + # 重定向输出与重定向错误输出,且log.log不同于log.txt + os.system("python manage.py runserver " + ip[:-1] + ":8000 >> log.log 2>&1 & \n") + print("The backend is running!") \ No newline at end of file