我发现了一些关于我的问题的问题,您的解决方案对我没有帮助,所以我开始了一个新问题。基本上这就是我看到管理页面的方式
阿帕奇的配置:
<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}),
)
设置.py:
MEDIA_ROOT = '/var/www/webproxy/media/'
STATIC_ROOT = '/var/www/webproxy/static/'
WEBPROXY_MEDIA_ROOT = '/var/www/webproxy/static/media/'
我不确定这里有什么问题。任何帮助将非常感激。