django-admin-interface: Logo & Favicon not rendering
I’ve configured everything as it should be but Django cannot find the favicon or logo. What am I missing?
# settings.py
STATIC_URL = "/static/"
STATIC_ROOT = os.path.join(BASE_DIR, "staticfiles")
MEDIA_ROOT = os.path.join(BASE_DIR, "media")
MEDIA_URL = "/media/"
# urls.py
from django.contrib import admin
from django.urls import path
from django.conf.urls.static import static
from django.conf import settings
urlpatterns = [
path("", admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)
I can see that the files are correctly being stored as expected: app\media\admin-interface\favicon\favicon.ico
Python version 3.10.12
Django version 4.2.4
Package version 0.26.0
Current behavior (bug description)
[DJANGO] WARNING 2023-08-13 12:52:56,660 log django.request.log_response:241: Not Found: /media/admin-interface/favicon/favicon.ico
[DJANGO] WARNING 2023-08-13 12:53:26,440 log django.request.log_response:241: Not Found: /media/admin-interface/logo/Logo_kyvHNK9.png
Expected behavior I’m expecting the favicon and logo to render in the admin GUI.
Upvote & Fund
- We’re using Polar.sh so you can upvote and help fund this issue.
- We receive the funding once the issue is completed & confirmed by you.
- Thank you in advance for helping prioritize & fund our backlog.
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 18 (10 by maintainers)
@CharlesFr During production enviroment system you should create (if your system is inside a docker container) a named volume with entire folder upload media for logo and favicon with created by admin_interface application
like this
and is base settings of project:
othwrwhise in
urls.py
of the projects (not in app):They are not mentioned because are standard django settings that must always be configured correctly to use media and static files.