擅长:python、mysql、java
<p>当然不是虫子</p>
<blockquote>
<p><strong>I don't understand where does this django/forms/templates path come from?</strong></p>
</blockquote>
<p>您可以在<a href="https://docs.djangoproject.com/en/1.11/_modules/django/forms/widgets/#Textarea" rel="noreferrer">source code</a>处查看该行</p>
<pre><code>[docs]class Textarea(Widget):
template_name = 'django/forms/widgets/textarea.html'
</code></pre>
<p>这是你第一个问题的来源。现在是第二个</p>
<blockquote>
<p>This renderer uses a standalone DjangoTemplates engine (unconnected to what you might have configured in the TEMPLATES setting). It loads templates first from the built-in form templates directory in django/forms/templates and then from the installed apps’ templates directories using the app_directories loader.</p>
</blockquote>
<p>对于窗体小部件类也是如此。要使自定义小部件模板正常工作,必须使用相同的术语指定路径,如<code>app_name/forms/widget/textarea.html</code></p>