user_image
By  徒儿活着    On   2019年10月16日 16:49

刘老师,您好。您的资料非常详细,刚刚学完python基础语法和pycharm。 可能是配置环境有问题吧,我按照您的教成做。在项目中的views中,加入如下代码: from django.contrib import admin from django.urls import include from django.urls import path urlpatterns = [ path('polls/', include('polls.urls')), path('admin/', admin.site.urls), ] 编译时出错了,返回很多错误,最后如下: django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings. 请问这是什么原因造成的呢?