from django.http import HttpResponseRedirect from django.core.urlresolvers import reverse from django.shortcuts import render_to_response,get_object_or_404,redirect from django.template import RequestContext from builder.base import BuildWriting, BuildWritingFeed, BuildMap, BuildPages, BuildPhotos,BuildAbout,BuildProjects,BuildSitemap,BuildContact def do_build(request): section = request.GET.get('id', '') if section != '': #build writing archives if section == 'writing': BuildWriting().build() context = {'message': 'Writing Posts to Disk',} #build photo galleries elif section == 'photos': BuildPhotos().build() context = {'message': 'Writing Photo Galleries to Disk',} #build project pages elif section == 'projects': BuildProjects().build() context = {'message': 'Writing Project pages to Disk',} #build pages elif section == 'pages': BuildPages().build() context = {'message': 'Writing Pages to Disk',} #build map elif section == 'map': BuildMap().build() context = {'message': 'Writing Map to Disk',} #build Writing RSS Feed elif section == 'feed': BuildWritingFeed().build() context = {'message': 'Writing RSS Feed to Disk',} #build Sitemap elif section == 'sitemap': BuildSitemap().build() context = {'message': 'Writing Sitemap to Disk',} #build Everything need for new post elif section == 'newpost': #build writing archives/details pages/homepage BuildWriting().build() #build map BuildMap().build() #build feed BuildWritingFeed().build() #build sitemap BuildSitemap().build() context = {'message': 'Publishing New Post',} #build Homepage elif section == 'home': BuildWriting().build_homepage() context = {'message': 'Writing Homepage to Disk',} """ elif section == 'all': g.build_entire_site() context = {'message': 'Writing Entire Site to disk',} """ else: context = {} #return redirect('/admin/', message='test') return render_to_response('admin/message.html', context, context_instance = RequestContext(request))