static/rest_framework/css/bootstrap.min.css” does not exist

Viewed 931

I got with Django rest framework problem when I deployed Django project in production mode

if I go to http://127.0.0.1:8000/myproj/api/v1/persons.json everything is displayed correctly

if I go to https://example.com/myproj/api/v1/persons.json?format=api - layout breaks

in the page code I see: link rel="stylesheet" type="text/css" href="/static/rest_framework/css/bootstrap.min.css"

if I navigate to the path https://example.com/static/rest_framework/css/bootstrap.min.css I see this error in the browser:

Page not found (404)

“/data/Projects/myproj_dev/Django/myproj/static/rest_framework/css/bootstrap.min.css” does not exist

Request Method: GET

Request URL: https://example.com/static/rest_framework/css/bootstrap.min.css

Raised by: django.views.static.serve

Using the URLconf defined in myproj.urls, Django tried these URL patterns, in this order:

admin/

myproj/

^static/(?P<path>.*)$

The current path, static/rest_framework/css/bootstrap.min.css, matched the last one.

I tried to find the file bootstrap.min.css and found it along this path:

/data/Projects/myproj_dev/Django/myproj_venv/lib/python3.8/site-packages/rest_framework/static/rest_framework/css/bootstrap.min.css, but I don’t know what to do with it

Unfortunately, I was unable to solve this problem.

0 Answers
Related