正如您在网站上看到的那样:http ://www.workshopvenues.com /assets/* 下 的静态文件未正确加载。
我希望这个网址(例如)有效:http ://www.workshopvenues.com/assets/ico/apple-touch-icon-144-precomposed.png 但它不是(因为您可以验证点击它)。
这就是我的settings.py
STATIC_ROOT = '/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets/'
STATIC_URL = 'http://www.workshopvenues.com/assets/'
STATICFILES_DIRS = (
'/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets/',
)
路径是正确的,我已经仔细检查了它们:
ptlugorg@ptlug.org [~/workshopvenues/workshopvenues/workshopvenues/assets]# pwd
/home6/ptlugorg/workshopvenues/workshopvenues/workshopvenues/assets
如果它可能有帮助,我正在使用 fastcgi 为网站提供服务。我已按照此处的说明进行操作http://simplyargh.blogspot.co.uk/2012/04/python-27-django-14-on-bluehost.html
这些是我的配置文件。
.htaccess
ptlugorg@ptlug.org [~/public_html/workshopvenues]# cat .htaccess
AddHandler fcgid-script .fcgi
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ workshopvenues.fcgi/$1 [QSA,L]
Workshopvenues.fcgi
ptlugorg@ptlug.org [~/public_html/workshopvenues]# cat workshopvenues.fcgi
#!/home6/ptlugorg/python27/bin/python27
import sys, os
# Add a custom Python path.
sys.path.insert(0, "/home6/ptlugorg/python27")
sys.path.insert(13, "/home6/ptlugorg/workshopvenues/workshopvenues")
os.environ['DJANGO_SETTINGS_MODULE'] = 'workshopvenues.settings'
from django.core.servers.fastcgi import runfastcgi
runfastcgi(method="threaded", daemonize="false")
以防万一您想知道权限:
ptlugorg@ptlug.org [~/workshopvenues/workshopvenues/workshopvenues]# ls -al
total 52
drwxr-xr-x 3 ptlugorg ptlugorg 4096 Aug 9 03:31 ./
drwxr-xr-x 4 ptlugorg ptlugorg 4096 Aug 9 02:52 ../
drwxr-xr-x 11 ptlugorg ptlugorg 4096 Aug 8 15:33 assets/
-rw-r--r-- 1 ptlugorg ptlugorg 0 Aug 8 14:23 __init__.py
-rw-r--r-- 1 ptlugorg ptlugorg 144 Aug 8 14:25 __init__.pyc
-rw-r--r-- 1 ptlugorg ptlugorg 430 Aug 8 15:20 secrets.py
-rw-r--r-- 1 ptlugorg ptlugorg 527 Aug 8 15:20 secrets.pyc
-rw-r--r-- 1 ptlugorg ptlugorg 5779 Aug 9 03:31 settings.py
-rw-r--r-- 1 ptlugorg ptlugorg 3399 Aug 9 03:31 settings.pyc
-rw-r--r-- 1 ptlugorg ptlugorg 614 Aug 8 14:23 urls.py
-rw-r--r-- 1 ptlugorg ptlugorg 467 Aug 8 15:23 urls.pyc
-rw-r--r-- 1 ptlugorg ptlugorg 1150 Aug 8 14:23 wsgi.py
-rw-r--r-- 1 ptlugorg ptlugorg 1058 Aug 8 15:21 wsgi.pyc
ptlugorg@ptlug.org [~/workshopvenues/workshopvenues/workshopvenues/assets]# ls -al
total 48
drwxr-xr-x 11 ptlugorg ptlugorg 4096 Aug 8 15:33 ./
drwxr-xr-x 3 ptlugorg ptlugorg 4096 Aug 9 03:31 ../
drwxr-xr-x 5 ptlugorg ptlugorg 4096 Aug 8 15:33 admin/
drwxr-xr-x 5 ptlugorg ptlugorg 4096 Aug 8 14:23 bootstrap/
drwxr-xr-x 2 ptlugorg ptlugorg 4096 Aug 8 14:23 css/
drwxr-xr-x 5 ptlugorg ptlugorg 4096 Aug 8 15:33 django_extensions/
drwxr-xr-x 2 ptlugorg ptlugorg 4096 Aug 8 14:23 font-awesome/
drwxr-xr-x 2 ptlugorg ptlugorg 4096 Aug 8 14:23 ico/
drwxr-xr-x 7 ptlugorg ptlugorg 4096 Aug 8 14:23 img/
drwxr-xr-x 2 ptlugorg ptlugorg 4096 Aug 8 14:23 js/
drwxr-xr-x 5 ptlugorg ptlugorg 4096 Aug 8 14:23 prettyPhoto/
一切似乎都是正确的,但它仍然无法按预期工作。你知道问题可能出在哪里吗?我可以做哪些测试来验证是否有问题?
谢谢你的帮助!