On Mon, 2006-08-14 at 10:40 -0700, hernan43 wrote:
> First let me say that I loathe using the term 'caching' to describe
> this problem as it probably has nothing to do with caching. But my
> primitive vocabulary is at a loss for a better word.
> 
> I have a very simple Django blog app that I'm using to learn more about
> the Django framework. I notice that when I add a blog entry, it doesn't
> show up right away. Sometimes it takes more than a day before it will
> show up. Other times it will post right away.
> 
> If I add a post and it doesn't show up right away, all I need to do is
> to bounce Apache and boom there it is. I'm not sure what exactly I am
> doing wrong. I don't have any caching enabled. I'm not loading the
> caching middleware or anything like that.
> 
> I wonder if my Apache config might not be as correct as it should be. I
> have tried tweaking the maxrequestsperchild, but I still see the same
> behavior.
> 
> Would anyone know what I should be looking at? I am certain that this
> is my fault. i have been googling the mailing list and I don't really
> see anything that looks the same as my problem. Thanks in advance for
> any help.

Very odd (my first guess would have been timezones as well, but you've
ruled that out).

One thing to check would be the headers returned from the request to the
server. Is the server giving you a new version or a cached version. If
you are using something like Linux or Mac-OS, a command like "curl
-i ..." (or "curl -I ..." to *just* see the headers) will be useful. Or
your browser might be able to show you the headers.

On the server side, try putting some logging statements into the code
where you query for your list of blog entries. Print the length of that
list and the dates or something. Just to check that it's retrieving the
right data. If you print to sys.stderr, the results will appear in
Apache's error_log (although mod_python buffers sys.stderr (grr!), so
you have to call sys.stderr.flush() as well if you want to see the
results immediately).

One mistake people sometimes make is passing a query set in the
extra_context to a generic view and expecting it to be updated on each
call -- it isn't (see the docs for the generic views for an
exaplanation), although the main queryset you pass in is requeried on
each call to the view. This one is a long shot, since I can't imagine
you would be doing this to present blog posts, but we've seen it half a
dozen times in the past few months, so it's not out of the bounds of
possibility.

Really, beyond starting to put fencepost prints in your code to see what
is being called when, it's a little hard to suggest other things. It
does sound like something isn't being evaluated afresh each time,
though. Shouldn't be too hard to narrow down.

Regards,
Malcolm


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users
-~----------~----~----~----~------~----~------~--~---

Reply via email to