Django version is .96, but I'm not sure about the exact build. I know
maxlength is still max_length in the build I'm using, if that helps. I
know there's some way to check the exact build, but I don't know how.

What I've got going is a legacy php site that's drawing the latest
forum posts over via curl. Up until today, it was picking up the forum
feed, but today I wrote a simple view and template (which gave me some
extra flexibility anyway, and the php on the other end doesn't have to
parse the RSS, so that's a couple of advantages).

Here's the view:
def latest_snippet(request):
        topics = Topic.objects.all().order_by('-topic_modification_date')
[0:5]
        for i in topics:
                posts = i.topic_posts
                i.pagination_max = (posts/20)+1
                if posts%20 == 0:
                        i.pagination_max = posts/20
                for post in i.post_set.all()[0:1]:
                    i.fpost = post
        return render_to_response('forum/snippet.html', {
                'topics': topics,
        })

Yes, I know... it's not very good code. I'm not a very good coder --
but I'm working on it.

Template is nothing special. Just builds an unordered list from
topics.

The php on the other end is nothing special either. It just grabs the
snippet the template creates and pulls it over.
<?php
$feed = 'http://classicmotorsports.net/forum/snippet/';
 if( function_exists('curl_init') ) { // CURL is available
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL,$feed);
    curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
    $rdata = curl_exec ($ch);
 } elseif( function_exists('file_get_contents') ) {
     $rdata = file_get_contents($feed);
 }
echo $rdata;
?>

The caching appears to work fine until that external site calls for
that feed. Then it all goes sideways. The site caching itself appears
fine. I'm 98% sure it's somehow related to that external call.

Since it was working off the feed, at first I thought that's where the
problem lie, so I created the new view and template. Either way, with
memcached it just proxy errors, and the external site fails loading
the snippet.

With locmem I got the arcane error I posted on the group.
I've been looking at never_cache, and just not worrying about caching
that one view, but haven't figured out how to implement it.

Using CACHE_BACKEND = 'file:///home/grmadmin/webapps/django/classic/
cache'

I don't get an error. So maybe it's somehow based on memory caching?


--~--~---------~--~----~------------~-------~--~----~
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?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to