需要一些幫助,爲什麼靜態文件不顯示。不知道我做錯了什麼。我相信我在Django docs上正確地執行了這些步驟。Django靜態文件 - 我錯過了什麼?
下面是我用的Django版本1.6.1服用
$ django-admin.py startproject django_test_static
$ cd django_test_static
$ ./manage.py startapp testapp
$ mkdir -p testapp/static/testapp
$ echo "hi there" > testapp/static/testapp/test.txt
$ ./manage.py runserver
隨後的步驟,當我試圖檢索文件,這是行不通的:
[26/Jan/2014 17:05:40] "GET /static/testapp/test.txt HTTP/1.1" 404 1652
1.6.1來預先加載了django.contrib.staticfiles
和STATIC_URL = '/static/'
。
我做錯了什麼。什麼?!
您是否將DEBUG設置爲True(請參閱django.contrib.staticfiles.views.serve())。 – gdoumenc
是 - 正在使用默認安裝。除了通過命令行顯示的內容外,沒有其他更改。包括'django.contrib.staticfiles'。 – thornomad
看看[我的答案](http://stackoverflow.com/questions/21223884/html-background-image/21224602#21224602)到以前的問題。通過該清單來捕捉任何明顯的事情。 – Stephan