Skip to content

Commit

Permalink
feat: Add favicon support by including favicon.ico route and updating…
Browse files Browse the repository at this point in the history
… base template
  • Loading branch information
AhmedNassar7 committed Dec 25, 2024
1 parent 858cad3 commit 6418905
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 0 additions & 2 deletions egypt_metro/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
3 changes: 3 additions & 0 deletions egypt_metro/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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'),

Expand Down
1 change: 1 addition & 0 deletions templates/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<link rel="icon" href="{% static 'favicon.ico' %}" type="image/x-icon">

0 comments on commit 6418905

Please sign in to comment.