问题:
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined
解决办法:
import os import django django.setup() os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
问题:
ImportError: Settings cannot be imported, because environment variable DJANGO_SETTINGS_MODULE is undefined
解决办法:
import os import django django.setup() os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'mysite.settings')
转载于:https://www.cnblogs.com/zhengze/p/10365561.html