After hosting my Django project on PythonAnywhere, the Django Admin login page looks like this:
I have run python manage.py collectstatic
and this still happens.
There are many errors in the Javascript console that include:
Refused to apply style from 'example.com/static/admin/css/dark_mode.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
The other errors also reference to MIME. This is my settings.py:
STATIC_URL = "/static/"
STATICFILE_DIRS = [BASE_DIR / 'static']
STATIC_ROOT = '/home/mywebsite/surveys/static'
I also get these error in the error log:
2023-06-22 11:37:29,062: Not Found: /static/admin/css/dark_mode.css
2023-06-22 11:37:29,063: Not Found: /static/admin/css/base.css
2023-06-22 11:37:29,215: Not Found: /static/admin/css/nav_sidebar.css
2023-06-22 11:37:29,224: Not Found: /static/admin/css/login.css
2023-06-22 11:37:29,403: Not Found: /static/admin/css/responsive.css
2023-06-22 11:37:29,404: Not Found: /static/admin/js/nav_sidebar.js
2023-06-22 11:37:29,408: Not Found: /static/admin/js/theme.js
Can anyone tell me why this is happening?