三步:
-
创建一个 favicon.ico 文件
-
修改 urls.py , 添加 "/favicon.ico" 路径。
- 修改 html 模版
1、修改 html 模版
在 html 模版的 head 部分添加:
<link REL="SHORTCUT ICON" HREF="{{ MEDIA_URL }}images/favicon.ico">
2、在 urls.py 里添加:
(r'^favicon\.ico$', 'django.views.generic.simple.redirect_to', {'url': settings.MEDIA_URL+'images/favicon.ico'}),
转别人的,可能过段时间会用到,没有测试过,应该没问题吧。