Django Admin CSS не загружается
Я пытаюсь заставить мою Django admin иметь css, как он выглядит в разработке, но ничего не получается.
Я пробовал следующие вещи:
- Have following static value in settings.py
# Default primary key field type
# https://docs.djangoproject.com/en/3.2/ref/settings/#default-auto-field
DEFAULT_AUTO_FIELD = 'django.db.models.BigAutoField'
STATICFILES_DIRS = [os.path.join(BASE_DIR,'staticfiles')]
STATIC_ROOT = os.path.join(BASE_DIR, 'static')
MEDIA_ROOT = os.path.join(BASE_DIR, 'media')
MEDIA_URL = '/'
- Add
mimetypes.add_type("text/css", ".css", True)
. - Since the console error was showing "Refused to apply style from 'https://example.org/admin/login/?next=/static/admin/css/base.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled."
- I ran
python manange.py collectstatic
. (Admin static files are available in static folder as well). - I set
Debug=False
as well
Я не могу понять, в чем проблема. Любые идеи приветствуются. Заранее спасибо