from django.shortcuts import render_to_response from pages.build import builder as page_builder from builder.base import BuildSitemap, BuildRSS from blog.build import essaybuilder, homebuilder from links.build import linkbuilder def do_build(request): section = request.GET.get('id', '') context = {} if section == 'essays': context = {'message': 'Writing Essays to Disk'} essaybuilder() if section == 'links': context = {'message': 'Writing Links to Disk'} linkbuilder() if section == 'pages': context = {'message': 'Writing Pages to Disk'} page_builder() if section == 'home': context = {'message': 'Writing Homepage to Disk'} homebuilder() if section == 'sitemap': context = {'message': 'Writing Sitemap to Disk'} j = BuildSitemap("blog", "Entry") j.build() if section == 'rss': context = {'message': 'Writing RSS feed to Disk'} j = BuildRSS("blog", "Entry") j.build() return render_to_response('admin/message.html', context)