首先,讓我說,我是個學生努力學習Django的... 我完成我的應用程序throught教程和IM具有帶我的模板的圖像呈現出的問題,其僅僅顯示與出的圖像幀......這裏是我的html代碼:Django的靜態IMG在我的博客不會顯示
<aside>
<h4>Historico</h4>
{% for month in months %}
<p><a href="{url 'blog.views.month' month.0 month.1}">{{ month.2 }}</a></p>
{% endfor %}
<h4>Sobre mi</h4>
<img class="pic" src="{{ STATIC_URL }}/static/img/foto.jpg" alt="foto"/>
<img class="picbig" src="{{ STATIC_URL }}/static/img/foto.jpg" alt="foto grande"/>
<p>Soy un doge san OP platino IV lan pls</p>
</aside>
我的形象「foto.jpg」心不是表現,這是我的靜態
STATIC_URL = '/static/'
STATICFILES_DIRS = (
"C:/Users/Abdul Hamid/PycharmProjects/misitioweb/static",
)
STATICFILES_FINDERS = (
'django.contrib.staticfiles.finders.FileSystemFinder',
'django.contrib.staticfiles.finders.AppDirectoriesFinder',
)
和settings.py我的IMG是這樣
的文件夾中`C:\Users\User-Name\PycharmProjects\misitioweb\`
`blog-
-templtates
--frontpage.html
--otherthing.html
-__init__.py
-admin.py
-models.py
-test.py
-views.py
mysite-
-__init__.py
-settings.py
-urls.py
-wsgi.py
manage.py
-etc..
static-
--img
---foto.jpg
`
我一直在試圖改變在diferent ressults img標籤的代碼一樣裝載的靜態文件夾放到這樣的模板: {{from static import staticfiles}}
即時做錯了什麼,我已經tryied尋找更多的信息,但沒有任何工作...請幫助我! 無論如何 感謝您的時間
你應該去通過官方Django的教程。這很好,不長,也很容易理解。我不是要告訴你,但你會在這裏找到答案:https://docs.djangoproject.com/en/1.6/intro/tutorial01/ – skzryzg