落就是一道风景线

运行在Apache中Django后台admin界面CSS丢失

| Comments

在 Apache 的 conf/extra/httpd-vhosts.conf 加入以下代码:

1
2
3
4
5
6
7
8
9
10
11
12
13
<VirtualHost *:80>

    <Directory "/usr/local/lib/site-packages/django/contrib/admin/media">
        Order Deny,Allow
        Allow from all
    </Directory>  
 
    Alias "/media" "/usr/local/lib/site-packages/django/contrib/admin/media"
    <Location "/media">
        SetHandler None
    </Location>

</VirtualHost>

Comments