I have created my first Django project, but in the admin panel, when I run http://127.0.0.1:8000/admin/
the CSS files is not loaded and I also created a new Django app but still got the same error, I have also visited the question but my problem is not solved: Django admin site not showing CSS style
It looks like this:
I can log in:
It should look like this:
settings.py
import os
STATIC_URL = '/static/'
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
urls.py
from django.contrib import admin
from django.urls import path, include
urlpatterns = [
path('admin/', admin.site.urls),
path('products/', include('products.urls'))
]
Note: I have used STATIC_ROOT = os.path.join(BASE_DIR, 'static')
in settings.py and also run the command python manage.py collectstatic
, but still, I got the same thing.