from django.shortcuts import redirect from eventplanner_gcal.google_sync import syncFromGoogleToLocal, syncFromLocalToGoogle from django.http import HttpResponse from django.views.decorators.csrf import csrf_exempt from pprint import pformat import logging logger = logging.getLogger( __name__ ) def runSync( request ): syncFromLocalToGoogle() return redirect("/") @csrf_exempt def gcalApiCallback( request ): # TODO check channel info here requestMetaStr = pformat( request.META ) logger.info( "Received Google Callback with the following headers:\n" + requestMetaStr ) result = syncFromGoogleToLocal() logger.info("Finished processing callback from GCal - New Information present: %1 " %(result, ) ) return HttpResponse('

Callback successful

')