擅长:python、mysql、java
<ol>
<li>确保<code>django.contrib.staticfiles</code>包含在^{<cd2>中。</li>
<li>在设置文件中,定义静态URL,例如:
<code>STATIC_URL = '/static/'</code></li>
<li>希望您将图像存储在<code>/static/projectname/image.png</code>文件夹中</li>
<li>最后在html中简单地添加以下内容</li>
</ol>
<p><code><img src="/static/projectname/image.png" alt="My image"/></code></p>
<p><a href="https://docs.djangoproject.com/en/1.10/howto/static-files/" rel="nofollow noreferrer">please refer django dcumentation</a></p>