Can not add favicon to my Django app


Can not add favicon to my Django app
I'm using Django 2.06 to develop an application. I'm trying to add Favicon but it's not working in my app.
<link rel="shortcut icon" href="% static 'favicon.ico' %" type='image/x-icon' >
<link rel="icon" href="% static 'favicon.ico' %" type='image/x-icon'>
I have mentioned % load static %
at base.html
file as well.
% load static %
base.html
from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static
from .views import HomeView, article_details, ArticleListView,
ProductPageView, ContactPageView
urlpatterns = [
path('', HomeView.as_view(), name='home'),
path('details/<int:id>/<slug:slug>', article_details, name='article-details'),
path('articles/', ArticleListView.as_view(), name='article-list-view'),
path('products/', ProductPageView.as_view(), name='product-page-view'),
path('contact/', ContactPageView.as_view(), name='contact-page-view'),
] + static(settings.STATIC_URL, document_root=settings.STATIC_ROOT)
I ran the link and it does not work..
'faviconfavicon.ico' could not be found
http://localhost:8000/static/favicon/favicon.ico
favicon.ico
Did you run collectstatic?
– guillermo chamorro
2 days ago
@ guillermo chamorro i ran collectstatic and it's same, does not work.
– Shohan
2 days ago
@Willem Van Onsem yes this link is working. i checked it thorugh Ctrl+U .
– Shohan
2 days ago
@Willem Van Onsem, accept my apology, the proposes link is not working but my location direction is ok.
– Shohan
2 days ago
By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.
Can you access the
favicon.ico
itself (through the proposed URL)?– Willem Van Onsem
2 days ago