我發現了幾個問題,我的問題,你的解決方案沒有幫助我,所以我開始了一個新的問題。基本上,這就是我看到管理頁面 Django管理頁面丟失圖像/ css/js
Apache的配置:
<VirtualHost *.*.*.*:80>
ServerName ********.org
ServerAdmin ****@******.org
WSGIScriptAlias//var/www/webproxy/webproxy/wsgi.py
DocumentRoot /var/www/cgi-bin/
ScriptAlias /cgi-bin/ /var/www/cgi-bin/
ErrorLog /var/www/webproxy/apache/error.log
LogLevel warn
CustomLog /var/www/webproxy/apache/access.log combined
Alias /media/ "/var/www/webproxy/media/"
<Directory "/var/www/webproxy/media/">
Options Indexes MultiViews FollowSymLinks
AllowOverride None
Order deny,allow
Allow from all
</Directory>
<Directory "/var/www/webproxy/static/">
Order deny,allow
Allow from all
</Directory>
這是我在urls.py:
from django.conf.urls.defaults import *
from django.contrib import admin
admin.autodiscover()
from core import urls as core_urls
from settings import MEDIA_ROOT, WEBPROXY_MEDIA_ROOT
urlpatterns = patterns('',
(r'^admin/', include(admin.site.urls)),
(r'^media/(?P<path>.*)$', 'django.views.static.serve', {'document_root': MEDIA_ROOT}),
(r'^ui/(?P<path>.*)$', 'django.views.static.serve', {'document_root': WEBPROXY_MEDIA_ROOT}),
)
settings.py:
MEDIA_ROOT = '/var/www/webproxy/media/'
STATIC_ROOT = '/var/www/webproxy/static/'
WEBPROXY_MEDIA_ROOT = '/var/www/webproxy/static/media/'
我不確定這裏有什麼問題。任何幫助將非常感激。
您的設置「MEDIA_ROOT」和「WEBPROXY_MEDIA_ROOT」的.py'值? –
我已更新問題 – KennyPowers
Django管理員媒體文件是否在上述任何靜態文件位置下複製(理想情況下符號鏈接)?編輯我的答案。 –