Ritu Singh
If static files are not being found in your Django application, there could be an issue in STATIC_URL in settings.py:
Check STATIC_URL in settings.py:
Ensure that you have the correct STATIC_URL in your settings.py file. It should point to the URL where your static files are served.
Also, check if the DEBUG = False
If you are getting DEBUG = False, Django will not handle static files. In this case you have to try the below codes to fix the issue.
Inside your MyProject/MyProject2/urls.py file, you can add another URL pattern to look for static files under the URL /static/*:
If you get mimetype errors of anytype, like I have had before in the past, you can import mimetypes in your MyProject/MyProject2/settings.py file:
Also, if you still want to set DEBUG = False and serve static files locally for testing, you can runserver in insecure mode:
Answered by:> apache
Credit:> Stackoverflow
Suggested reads:
>Sending Audio file from Django to Vue
>How to keep all query parameters intact when changing page in Django?
>Solved: TaskList View in Django
>Implement nested serializers in the Django rest framework
>Define blade component property in server - Laravel