django.request in get_response Not Found: /favicon.ico

遇到 django.request in get_response Not Found: /favicon.ico 問題, 新增對應 icon 即可解決問題,新增方法如下:

  1. urls.py 新增網址對應
# urls.py
from django.views.generic.base import RedirectView
url(r'^favicon\.ico$', RedirectView.as_view(url='/static/favicon.ico', permanent=True))
  1. 在 static 資料夾下新增 favicon.ico

可參閱: https://stackoverflow.com/questions/21938028/how-can-i-get-a-favicon-to-show-up-in-my-django-app

Was this article helpful? Votes: 0
Article details:
Published date: 21/02/2019 8:27AM
Last updated: 21/02/2019 8:27AM (Kevin - kevin.huang@nuwainfo.com)
Share article: 
Author: Kevin (kevin.huang@nuwainfo.com)