pyinstaller安装django程序的环境变量处理
环境变量从文件获取在一个全局的变量里面settings.py中存在一个数据库的设置with open('/opt/pg.json','r',encoding='utf8')as fp: json_data = json.load(fp)DATABASES = json_data这句话成功的将读数据库操作从环境变量变成了读配置文件配置文件/opt/pg.json是这样写的{ "default": { "ENGINE": "django.db.back...