在python环境下运行脚本 import os if __name__ == '__main__': import django import sys pwd = os.path.dirname(os.path.realpath(__file__)) sys.path.insert(0