diff --git a/backend/config/urls.py b/backend/config/urls.py index 80e10fe9..b4a38fe3 100644 --- a/backend/config/urls.py +++ b/backend/config/urls.py @@ -15,6 +15,7 @@ Including another URLconf """ import os import re +from pathlib import Path from django.conf import settings from django.contrib import admin @@ -36,6 +37,7 @@ schema_view = get_schema_view( urlpatterns = [] if settings.DEBUG or os.environ.get("STANDALONE", False): + static_dir = Path(__file__).resolve().parent.parent / "client" / "dist" # For showing images and audios in the case of pip and Docker. urlpatterns.append( re_path( @@ -44,6 +46,8 @@ if settings.DEBUG or os.environ.get("STANDALONE", False): {"document_root": settings.MEDIA_ROOT}, ) ) + # For showing favicon on the case of pip and Docker. + urlpatterns.append(path("favicon.ico", serve, {"document_root": static_dir, "path": "favicon.ico"})) urlpatterns += [ path("admin/", admin.site.urls),