def main(): # os.environ.setdefault(‘DJANGO__MODulE‘,‘testDjango.settings‘) os.environ.setdefault(‘DJANGO_SETTINGS_MODulE‘,‘testDjango.settings‘) try: from django.core.management import execute_from_command_line except importError as exc: raise importError( "Couldn‘t import Django. Are you sure it‘s installed and " "available on your PYTHONPATH environment variable? DID you " "forget to activate a virtual environment?" ) from exc execute_from_command_line(sys.argv)if __name__ == ‘__main__‘: main()
部署服务器以后 修改
修改配置
DJANGO_SETTINGS_MODulE我也不知道为啥。。。。就这么成功了总结
以上是内存溢出为你收集整理的Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment全部内容,希望文章能够帮你解决Note that only Django core commands are listed as settings are not properly configured (error: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)