Garfonzo
Garfonzo

Reputation: 3966

Django - CSS problems

This is more of a "why does this happen" kind of question, as it isn't a big deal. It would be great to have it stop, but I'm OK with it sticking around.

I have a webapp I made with Django. I have two servers: a development server and a production server. I have all the CSS/img/js files loading correctly and everything works fine on both servers. Sort of. The production server is working flawlessly (everything loads as it should for CSS/imgs/Javascript)

I do all my development on the dev server and use Django's test server while I code. When I first do the runserver command, I open up my browser (Chrome, specifically). I navigate to my 192.1.1.123:8080 address and there is my Django web app, but with none of the CSS loaded. What I then have to do is open a second tab (leaving the first open) navigate to my 192.1.1.123:8080 again, and then all the CSS loads (without restarting the django web server). I believe this is a browser trait - something about cache. But I'm not sure.

Any idea as to why this happens?

Upvotes: 0

Views: 277

Answers (1)

Bruce
Bruce

Reputation: 1380

I had similar problems when I was working on several Django projects and I was switching between them. The browser cached all static content and didn't noticed that the file changed by switching to another project. Reload the page with CTRL+F5 should solve it.

Upvotes: 1

Related Questions