def blogroll(request, btype): """ View that handles the generation of blogrolls. """ response, site, cachekey, sfeeds_obj, sfeeds_ids = initview(request) if response: return response # for some reason this isn't working: # #response = render_to_response('feedjack/%s.xml' % btype, \ # fjlib.get_extra_content(site, sfeeds_ids)) #response.mimetype = 'text/xml; charset=utf-8' # # so we must use this: template = loader.get_template('feedjack/%s.xml' % btype) ctx = {} fjlib.get_extra_content(site, sfeeds_ids, ctx) ctx = Context(ctx) response = HttpResponse(template.render(ctx) , \ mimetype='text/xml; charset=utf-8') patch_vary_headers(response, ['Host']) fjcache.cache_set(site, cachekey, response) return response
def blogroll(request, btype): """ View that handles the generation of blogrolls. """ response, site, cachekey, sfeeds_obj, sfeeds_ids = initview(request) if response: return response # for some reason this isn't working: # #response = render_to_response('feedjack/%s.xml' % btype, \ # fjlib.get_extra_content(site, sfeeds_ids)) #response.mimetype = 'text/xml; charset=utf-8' # # so we must use this: template = loader.get_template('feedjack/%s.xml' % btype) ctx = {} fjlib.get_extra_content(site, sfeeds_ids, ctx) ctx = RequestContext(request, ctx) response = HttpResponse(template.render(ctx) , \ mimetype='text/xml; charset=utf-8') patch_vary_headers(response, ['Host']) fjcache.cache_set(site, cachekey, response) return response
def blogroll(request, btype): 'View that handles the generation of blogrolls.' response, site, cachekey = initview(request) if response: return response[0] template = loader.get_template('feedjack/{0}.xml'.format(btype)) ctx = dict() fjlib.get_extra_content(site, ctx) ctx = Context(ctx) response = HttpResponse( template.render(ctx), mimetype='text/xml; charset=utf-8' ) patch_vary_headers(response, ['Host']) fjcache.cache_set( site, cachekey, (response, ctx['last_modified']) ) return response
def blogroll(request, btype): """ View that handles the generation of blogrolls. """ response, site, cachekey, sfeeds_obj, sfeeds_ids = initview(request) if response: return response template = loader.get_template('feedjack/%s.xml' % btype) ctx = {} fjlib.get_extra_content(site, sfeeds_ids, ctx) ctx = Context(ctx) response = HttpResponse(template.render(ctx) , \ content_type='text/xml; charset=utf-8') patch_vary_headers(response, ['Host']) fjcache.cache_set(site, cachekey, response) return response