From 64189055ec3943bbbd43dba6423e25ff36e57545 Mon Sep 17 00:00:00 2001 From: Ahmed Nassar Date: Wed, 25 Dec 2024 05:00:30 +0200 Subject: [PATCH] feat: Add favicon support by including favicon.ico route and updating base template --- egypt_metro/settings.py | 2 -- egypt_metro/urls.py | 3 +++ templates/base.html | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 templates/base.html diff --git a/egypt_metro/settings.py b/egypt_metro/settings.py index fa42cb5..54b52ee 100644 --- a/egypt_metro/settings.py +++ b/egypt_metro/settings.py @@ -59,7 +59,6 @@ 'drf_yasg', # Swagger "constance", # Dynamic settings "constance.backends.database", # Database backend for Constance - # "debug_toolbar", # Debug toolbar # Custom apps "apps.users.apps.UsersConfig", # Users app @@ -79,7 +78,6 @@ "corsheaders.middleware.CorsMiddleware", # CORS middleware "allauth.account.middleware.AccountMiddleware", # Account middleware "django.middleware.clickjacking.XFrameOptionsMiddleware", # Clickjacking middleware - # "debug_toolbar.middleware.DebugToolbarMiddleware", # Debug toolbar middleware ] ROOT_URLCONF = "egypt_metro.urls" # Root URL configuration diff --git a/egypt_metro/urls.py b/egypt_metro/urls.py index 0533cbc..11fda68 100644 --- a/egypt_metro/urls.py +++ b/egypt_metro/urls.py @@ -22,6 +22,7 @@ from egypt_metro import settings from .views import health_check, home # from django.conf.urls.static import static +from django.views.generic import RedirectView from drf_yasg.views import get_schema_view from drf_yasg import openapi from rest_framework.permissions import AllowAny @@ -55,6 +56,8 @@ # Home path("", home, name="home"), # Home view + path('favicon.ico', RedirectView.as_view(url=settings.STATIC_URL + 'favicon.ico')), # Favicon + # Check environment # path('check-environment/', check_environment, name='check_environment'), diff --git a/templates/base.html b/templates/base.html new file mode 100644 index 0000000..72beda0 --- /dev/null +++ b/templates/base.html @@ -0,0 +1 @@ +