why my django admin site does not have the css style

后端 未结 19 1972
南笙
南笙 2020-12-02 07:49

I make a Django admin site using Django development version

But it does not have a CSS style :

\"alt

19条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-02 08:37

    Same sort of issue i encountered while developing a site in django-1.10.5 and python-2.7.13. But in my firefox-51 and chrome, the login page was able to get the css but still there was no styling. But weirdly it was working on IE-8..

    I tried do every possible thing mentioned here and suitable to my set of sw versions. None worked.

    But when i tried the same site on other system which had the python-2.7.8, it worked..

    Just posted if it may help someone...

    edited: later I found that in python-2.7.13, writing the following two lines in settings.py (plus clearing the cache of the browser) had done the trick

    import mimetypes
    mimetypes.add_type("text/css", ".css", True)
    

提交回复
热议问题