Problem displaying admin in Django project

Viewed 38

I ran the Django project on the C panel, but it looks like this in the admin section.

image

2 Answers

You should collect static files

python manage.py collectstatic

and open the static files' URL by adding these rows to the project_name/urls.py file.

from django.conf             import settings
from django.conf.urls.static import static


urlpatterns = [
    ...
]

if settings.DEBUG:
    urlpatterns += static(settings.STATIC_URL, document_root = settings.STATIC_ROOT)

Maybe you should add root and URL paths in the project_name/setting.py file.

STATIC_URL = '/static/'

STATIC_ROOT = os.path.join(BASE_DIR, "static/")
Related