2013-10-03 90 views

回答

0

這可能是簡單的,你必須Django管理靜態文件鏈接到生產文件由您的Apache2使用。

let say that your web production files are in /var/www/www.localhost.com/ 


in the settings.py files add the path ADMIN_MEDIA_PREFIX = '/localhost/admin_media/' 

now you have to link the static file to django default admin static files : 
by using [apps_path_to_admin_static]$ sudo ln -s [path to django]/static/admin 
example : 
[email protected]:/var/www/www.localhost.com/localhost/static$ sudo ln - s 
/usr/local/lib/python2.7/dist-packages/django/contrib/admin/static/admin 

in apache2 virtualhost add the path: 

Alias /admin_media /var/www/www.localhost.com/localhost/static/admin_media