'MIME type ('text/html') not a supported stylesheet MIME type, and strict MIME checking is enabled in Django Web Application

I am hosting a Django web application on a cPanel web hosting server. I have the application up and running however it is not applying the CSS stylesheets to my index.html template or my admin console. I receive the following error Refused to apply style from 'https://website/staticfiles/admin/css/nav_sidebar.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.

I ran the collectstatic command and the admin CSS files and my CSS files are inside the staticfiles directory. I am not sure what else I can do to fix this issue, the media files are rendering correctly I am only having issues with the static CSS files.

settings.py

INSTALLED_APPS = [
    'myapp',
    'django.contrib.admin',
    'django.contrib.auth',
    'django.contrib.contenttypes',
    'django.contrib.sessions',
    'django.contrib.messages',
    'django.contrib.staticfiles',
]

STATIC_URL = '/staticfiles/'
STATIC_ROOT = os.path.join(BASE_DIR, 'staticfiles/')
STATICFILES_DIRS = (
    os.path.join(BASE_DIR, "static/"),
)

MEDIA_URL = '/media/'
MEDIA_ROOT = os.path.join(BASE_DIR, 'media/')
urls.py

from django.conf.urls.static import static
from django.contrib.staticfiles.urls import staticfiles_urlpatterns

urlpatterns = [
    path('', include('SocialLinks.urls')),
    path('admin/', admin.site.urls),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

Directory structure is as follows

home
├─ userName
|  ├── myapp       
│  |    └── static
|  |    |   |-css
|  |    |   |  |-style.css
|  |    |__ staticfiles
|  |         |-css
|  |         |  |-style.css
|  |         |-admin
|  |         |  |-css
|  |         |    |-style.css
|  ├── templates


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source