其实网站加一个图标,在/static/images/里面放置favicon.ico
1. 直接url里修改
from django.views.generic.base import RedirectView
favicon_view = RedirectView.as_view(url='/static/favicon.ico', permanent=True)
urlpatterns = patterns(
...
url(r'^favicon\.ico$', favicon_view),
...
)
2. 或者在html里面修改
<link rel="shortcut icon" type="image/png" href="{{STATIC_URL}}/favicon.ico"/>
REF:http://stackoverflow.com/questions/21938028/how-can-i-get-a-favicon-to-show-up-in-my-django-app
本站文章如无特殊说明,均为本站原创,如若转载,请注明出处:django favicon配置 - Python技术站