Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/75.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 扩展base.html时:与#x27相反';带参数';()';和关键字参数';{}';没有找到。已尝试0个模式:[]_Python_Html_Django - Fatal编程技术网

Python 扩展base.html时:与#x27相反';带参数';()';和关键字参数';{}';没有找到。已尝试0个模式:[]

Python 扩展base.html时:与#x27相反';带参数';()';和关键字参数';{}';没有找到。已尝试0个模式:[],python,html,django,Python,Html,Django,仅当我不扩展base.html时,我的页面才会加载 添加标记时: {% extends "base.html" %} {% block content %} <p>hi</p> {% endblock %} 在设置.py中,静态url: STATIC_URL = '/static/' 它明确地说 Error during template rendering: in template .... error at line 0 在base.html中 我是Djang

仅当我不扩展base.html时,我的页面才会加载

添加标记时:

{% extends "base.html" %}
{% block content %}
<p>hi</p>
{% endblock %}
设置.py中,静态url:

STATIC_URL = '/static/'
它明确地说

Error during template rendering:  in template .... error at line 0
在base.html中

我是Django的新手-这是我的第二个应用程序。有人能告诉我这里发生了什么事吗?我已经删除了所有导入的内容,但它仍然不起作用。这是我当前的base.html

{%load staticfiles%}
标题
    {%if user.u经过身份验证%}
  • {%else%}
    {%endif%}
{%block content%}{%endblock%}
您不能将url templatetags保留为空字符串,因为模板标记
{%url%}
正在url.py中搜索url中任何可能的匹配项,但在您的情况下,它可能没有匹配项,因此会出现错误。

您不能将url templatetags保留为空字符串,因为模板标记
{%url%}
是在您的URL.py中搜索URL以查找任何可能的匹配项,但在您的情况下,它可能没有任何匹配项,因此会出现错误。

您的
视图中有什么。py
?def about(request):return render\u to\u response('about.html',RequestContext(request))我需要base.html的视图吗?我在上一个应用程序中没有使用它。
{%url'%}
可能是问题所在。它正在尝试查找不存在的URL名称。是的,您应该在{%URL'%}中提供URL名称。您的
views.py
?def about(request):return render_to_response('about.html',RequestContext(request)),我需要base.html的视图吗?我在上一个应用程序中没有使用它。
{%url'%}
可能是问题所在。它正在尝试查找不存在的URL名称。是的,您应该在{%URL'%}中提供URL名称啊!成功了!我想我可以留下空洞的价值观,不,学习,学习。非常感谢。啊!成功了!我想我可以留下空洞的价值观,不,学习,学习。多谢各位。
Error during template rendering:  in template .... error at line 0