补充
import sys,os ll = os.path.dirname(os.path.abspath(__file__)) #上一层目录 print(ll) print(os.path.abspath(__file__)) #文件绝对路径 BASE_DIR = sys.path.append(ll) #添加到环境变量中
补充
import sys,os ll = os.path.dirname(os.path.abspath(__file__)) #上一层目录 print(ll) print(os.path.abspath(__file__)) #文件绝对路径 BASE_DIR = sys.path.append(ll) #添加到环境变量中