pythondjangoadmin

why django admin static files doesn't load


Since I had started Django, I'm tackling some ridiculous problems. Recently, when I start a new project and I run it on the server, Django's admin CSS is not loaded. The last project I ran on the server, after a while it was okay, and the real Django admin template was there and the CSS was loaded and it was working. But this time again the same problem happened and I don't know how to solve it cause the project here is the photo is raw, with no special code. I don't know if it's Chrome problem or not, but I have tried it on other browsers and it was the same thing.

I would be glad if you can help me


Solution

  • the answer I found was to change STATIC_URL = 'static/' in settings.py to STATIC_URL = '/static/'. Only one '/' may change your whole admin appearance. This problem may not happens to everyone but running code in Pycharm, I had been tackling it for such a long time.