gpt4 book ai didi

Python django 无法导入名称 View

转载 作者:行者123 更新时间:2023-11-30 22:26:57 25 4
gpt4 key购买 nike

我已经设置了 django 并正在设置我的 url,例如

from django.conf.urls import include, url
from django.contrib import admin
from . import views

urlpatterns = [
url(r'^admin/', include(admin.site.urls)),
url(r'^home/$', views.homepage),
]

上面总是会产生错误

cannot import name views

项目结构

geoff
settings.py
urls.py //using this
wsgi.py

homepage
migrations->folder
_init_.py
.....others here
views.py

最佳答案

尝试:

from homepage import views

关于Python django 无法导入名称 View ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47089049/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com