Browse Source

Add url for favicon

pull/1958/head
Hironsan 2 years ago
parent
commit
c7359510db
1 changed files with 4 additions and 0 deletions
  1. 4
      backend/config/urls.py

4
backend/config/urls.py

@ -15,6 +15,7 @@ Including another URLconf
""" """
import os import os
import re import re
from pathlib import Path
from django.conf import settings from django.conf import settings
from django.contrib import admin from django.contrib import admin
@ -36,6 +37,7 @@ schema_view = get_schema_view(
urlpatterns = [] urlpatterns = []
if settings.DEBUG or os.environ.get("STANDALONE", False): 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. # For showing images and audios in the case of pip and Docker.
urlpatterns.append( urlpatterns.append(
re_path( re_path(
@ -44,6 +46,8 @@ if settings.DEBUG or os.environ.get("STANDALONE", False):
{"document_root": settings.MEDIA_ROOT}, {"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 += [ urlpatterns += [
path("admin/", admin.site.urls), path("admin/", admin.site.urls),

Loading…
Cancel
Save