Django无法在Apache服务器中获取管理静态文件。我能做什么?.................................... ......... .................................................. .............. ..................
<VirtualHost *:80>
ServerAdmin mazlum.agar@gmail.com
ServerName modeller.com
ServerAlias www.modeller.com
DocumentRoot /var/www/modeller
Alias /static/ /var/www/modeller/statik_dosyalar/
Alias /static/admin/ /usr/lib/python2.7/dist-packages/django/contrib/admin/static .
<Directory "/usr/lib/python2.7/dist-packages/django/contrib/admin/static/">
Order deny,allow
Allow from all
</Directory>
WSGIScriptAlias / "/var/www/modeller/modeller/wsgi.py"
<Directory /var/www/modeller>
Order deny,allow
Require all granted
</Directory>
<Directory /var/www>
Order deny,allow
Require all granted
</Directory>
<Directory /var/www/modeller/statik_dosyalar>
Order deny,allow
Require all granted
</Directory>
<Directory /var/www/modeller/static>
Order deny,allow
Require all granted
</Directory>
<Directory /var/www/modeller/media>
Order deny,allow
Require all granted
</Directory>
</VirtualHost>
答案 0 :(得分:0)
更改此
Alias /static/admin/ /usr/lib/python2.7/dist-packages/django/contrib/admin/static
到
Alias /static/admin/ "/usr/lib/python2.6/site-packages/django/contrib/admin/media"
在设置中:
ADMIN_MEDIA_PREFIX = '/static/admin/'