Django Rest Framework deploy show favicon 500 Internal Server Error

别说谁变了你拦得住时间么 提交于 2020-01-16 08:19:13

问题


I am trying to deploy my Django rest framework to aws eb but when I test the API, it shows

favicon.ico:1 GET http://myapp.....com/favicon.ico 500 (Internal Server Error)

I update my url.py of django project to

from django.views.generic.base import RedirectView  


 urlpatterns = [
        url('favicon.ico', RedirectView.as_view(
            url='/static/favicon/favicon.ico'))...]

But It still shows an internal error.

I already search and found similar questions but not a useful answer.

like that=> How do I edit the favicon in the browsable API in Django rest framework

how to handle favicon request in Django rest framework

My API is pretty separate from the frontend so I can't change frontend for this error.

Update

If I test on local like =>

http://127.0.0.1:8000/favicon.ico

it gets the same result with =>

http://127.0.0.1:8000/api/

来源:https://stackoverflow.com/questions/59623908/django-rest-framework-deploy-show-favicon-500-internal-server-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!