模板呈现期间出错没有模块命名字段Url标记

2024-04-25 22:03:20 发布

您现在位置:Python中文网/ 问答频道 /正文

几个月前我在我的电脑上建立了一个django网站,它成功了,我备份了这个项目,现在在一台新电脑上,它不工作了。该错误涉及URL标记。我在新电脑上重新设置了项目,但由于以下原因,项目无法加载:

Error during template rendering - No module named fields

它指向:{% url 'home' %}在我的基本模板中。你知道吗

这是你的答案基本.html:<a class="navbar-brand" href="{% url 'home' %}">

你知道吗视图.py地址:

def home(request):
    context = {}
    template = "index.html"
    return render(request, template, context)

你知道吗网址.py地址:

urlpatterns = [
    url(r'^$', 'projectname.views.home', name='home'),
]

我不明白为什么我会出现这个错误,这个代码以前是有效的。 谢谢

完整回溯(单引号):http://pastebin.com/y8mPiamq

完全回溯(没有单引号):http://pastebin.com/KetAnYxR


Tags: 项目pycomhttpurlhomerequest地址

热门问题