Managing Google AppEngine datastore maintenance

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
def requires_datastore_write(view):
    def newview(request, *args, **kwargs):
        from google.appengine.api import capabilities
        datastore_write_enabled = capabilities.CapabilitySet('datastore_v3', capabilities=['write']).is_enabled()
        
        if datastore_write_enabled:
            return view(request, *args, **kwargs)
        else:
            from django.shortcuts import render_to_response
            from django.template import RequestContext
            return render_to_response('maintenance.html', context_instance=RequestContext(request))
        
    return newview

More like this

  1. Google AppEngine Login Decorator by cmcavoy 6 years ago
  2. ImageField for Google App Engine by davepeck 4 years, 5 months ago
  3. Using Google Apps Premium infrastructure for user management by tommy 5 years, 8 months ago
  4. cache_page that does nothing by peterbe 4 years, 8 months ago
  5. Memento by manelvf 3 years, 3 months ago

Comments

(Forgotten your password?)