Resolve the Django Site Admin Admin page style sheet (CSS style) is missing

Source: Internet
Author: User
Tags django server

After activating the Admin admin page of the Django server with this tutorial, try opening http://127.0.0.1:8000/admin/as described in the tutorial, and discover that your browser appears as follows

It is obvious that, although the business logic is normal expression, but this has lost the CSS, the standard white background black Word interactive environment, always makes people feel uncomfortable.
I check the command line error message, found the following error message:

Well, it seems that we have found the problem, originally in the Lib directory mimetypes.py file encoding problem, now we open this file, add at the end of the file:

reload(sys)sys.setdefaultencoding(‘gbk‘)

After saving the exit, refresh the http://127.0.0.1:8000/admin/page and you will find:

Is it more comfortable than before?!! __(: 3"∠)

Resolve the Django Site Admin Admin page style sheet (CSS style) is missing

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.