python built in server not loading css

前端 未结 2 411
旧巷少年郎
旧巷少年郎 2020-12-10 17:46

when i runserver the django admin is missing css.The web console says that style sheet was not loaded because its MIME type,\"application/x-css\", is not \"text/css\". Thi

2条回答
  •  囚心锁ツ
    2020-12-10 18:23

    I just ran into the same problem. And it seems you are right about Dreamweaver. Adding above mentioned strings into settings.py didn't helped me.

    I have run search for .css at regedit and changed most suspicious registry keys/records which

    1. could be related to treating .css files as application/x-css type
    2. could be related to associating .css file extension to opening with applications, especially Dreamweaver.

    It took me two iterations and I can not say for sure which one was the right shot as it might needed some time to update some cache, etc.

    Though I changed it at two locations:

    1. HKEY_LOCAL_MACHINE\SOFTWARE\Classes\.css
    2. HKEY_CLASSES_ROOT\.css

    I renamed (by adding leading '--' so that it could be recovered if necessary) keys/records related to .css files association with all applications (including Dreamweaver, Notepad, etc.) and stating .css files as application/x-css type.

    After that the issue was resolved and Django CSS styles were correctly applied as it was expected.

提交回复
热议问题