Ошибка Mimetype в производстве django-react

Я установил react внутри django.

в settings.py

STATICFILES_DIRS = [
    BASE_DIR.joinpath('frontend', 'build', 'static'),
]

TEMPLATES = [
    {
        'BACKEND': 'django.template.backends.django.DjangoTemplates',
        'DIRS': [
            BASE_DIR.joinpath('frontend'),
        ],
        'APP_DIRS': True,
        'OPTIONS': {
            'context_processors': [
                'django.template.context_processors.debug',
                'django.template.context_processors.request',
                'django.contrib.auth.context_processors.auth',
                'django.contrib.messages.context_processors.messages',
            ],
        },
    },
]

в views.py

def index_view(request):
    return render(request, 'build/index.html')

в urls.py

urlpatterns = [
    re_path('.*', views.index_view, name='index'),
]

гот

Refused to apply style from 'https://example.com/static/css/main.e6c13ad2.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
vpn.ipractus.com/:1 Refused to execute script from 'https://example.com/static/js/main.c459ef9d.js' because its MIME type ('text/html') is not executable, and strict MIME type checking is enabled.
Вернуться на верх