在用pycharm上练习django小项目时
from django.conf.urls import url
from django.contrib import admin
from app01 import views
urlpatterns = [
url(r'^admin/', admin.site.urls),
url(r'^index/',views.index)
]
django.core.exceptions.ImproperlyConfigured: Requested setting DEFAULT_INDEX_TABLESPACE, but settings are not configured. You must either define the environment variable DJANGO_SETTINGS_MODULE or call settings.configure() before accessing settings.
尝试过在urls.py中添加以下代码,虽然不再报错,但响应不了网页地址127.0.0.1:8000
有哪位兄弟可以解决这个问题
运行整个项目不需要你写的那些代码,只有在后台操作数据库的时候才需要加上那些代码。启动后直接访问就可以
看下这篇博客,也许你就懂了,链接:pycharm Django报错:django.core.exceptions.ImproperlyConfigured: Requested setting INSTALLED_APPS