Django -- messing with the test server -- 304 errors and such -


while working on webapp (which requires login entire site) noticed funny "glitch" (if can call that). viewing django site, logged site (on test server) in chrome. logged out of site , closed chrome entirely.

i opened firefox , pasted in url django site, expecting taken login page. however, not asked log in, rather logged in. proceeded log out of site , close firefox.

i re-opened chrome log in, find there no css styling. logged in , whole site had lost css styling , test server kept given 304 errors css , img files.

i've figured out 304 error has time mis-matching (like django thinking logged out, in firefox logged in -- confused).

i wondering if avoidable, or if "feature" of test server? kind of thing happen in production mode too?


edit clarity of i'm asking:

will loss of styling , images due 304 error experiencing django test server continue occur when launch webapp apache?

thanks!

you've got questions 3 things:

  1. why logged in in firefox.
  2. why lost css styling in chrome.
  3. what 304 responses are.

unfortunately there quite few possible explanations first 2 issues you're seeing. there's nothing serious going wrong.

for first 2 issues try reverting fresh state , seeing if problems still occur. e.g. use clean django database (with no sessions) , try clear cached browser information (cookies, auth, cached files). admittedly quite time consuming way test problems, best general advice can give without being able examine situation directly.

luckily 304 responses aren't problem @ all. 304 means browser has file in cache. see conditional view processing:

when client next requests same resource, might send along header such if-modified-since, containing date of last modification time sent, or if-none-match, containing etag sent. if current version of page matches etag sent client, or if resource has not been modified, 304 status code can sent back, instead of full response, telling client nothing has changed.


Comments

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -