Solve the problem that the admin management page style sheet (CSS style) of Django site is missing

Time:2021-12-1

Refer to this articlecourseAfter activating the admin page of Django’s own server, followcourseAs described, try openinghttp://127.0.0.1:8000/admin/, find your browser as follows

Solve the problem that the admin management page style sheet (CSS style) of Django site is missing

It is obvious that although the business logic is expressed normally, CSS has been lost. The standard interaction environment with black characters on a white background is always unpleasant.
I checked the error messages on the command line and found the following error messages:

Solve the problem that the admin management page style sheet (CSS style) of Django site is missing

Well, it seems that we have found the problem. It turned out to be the encoding problem of the file called mimetypes.py. Now we open the file and add the following at the end of the file:

reload(sys)
sys.setdefaultencoding('gbk')

Refresh after saving and exitinghttp://127.0.0.1:8000/admin/Page, you will find:

Solve the problem that the admin management page style sheet (CSS style) of Django site is missing

Is it more comfortable than before__(:3」∠)