Apache2服务器在同一站点上显示与django服务器的不同接口
这些天来,我设置了apache2和mod_wsgi来保存我的django站点,但是当我使用hello world django站点进行测试时,apache2显示了django提供的服务器的不同接口,即,Apache2服务器在同一站点上显示与django服务器的不同接口,django,apache,mod-wsgi,Django,Apache,Mod Wsgi,这些天来,我设置了apache2和mod_wsgi来保存我的django站点,但是当我使用hello world django站点进行测试时,apache2显示了django提供的服务器的不同接口,即,manage.py runserver django服务器显示 阿帕奇显示了这一点 所以,我不知道我是否对apache做了什么错事?您没有正确地告诉apache您的静态媒体资产在哪里。请参阅中描述的别名指令: 这可能很简单,您必须将django管理员静态文件链接到apache2使用的生产文件
manage.py runserver
django服务器显示
阿帕奇显示了这一点
所以,我不知道我是否对apache做了什么错事?您没有正确地告诉apache您的静态媒体资产在哪里。请参阅中描述的别名指令:
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 :
ali@host:/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