Example #1
0
 def checking(*args, **kwargs):
     api_key = args[0].values.get('api_key', False)
     if not api_key:
         return Response(status=401)
     customer = ApiCustomer.all().filter('api_key =', api_key).get()
     if not customer or not customer.is_writer:
         return Response(status=401)
     return func(*args, **kwargs)
Example #2
0
def api_index(request):
    customers = ApiCustomer.all()
    return render_to_response('admin/api/index.html', {'customers':customers})