common/utilities.py
def cronjob(handler):
    """
    Wraps a view function that is a cron handler.

    If the request does not contain the magic cron header
    from Google App Engine, a 400 response is returned.

    If the view returns a response, the response is returned.

    If the view does not return a response a basic 300 response
    is returned.

    See: https://developers.google.com/appengine/docs/python/config/cron
    """
    @functools.wraps(handler)
    def handle(request, *args, **kwargs):
        if (not settings.IN_DEV and
            not request.META.get('HTTP_X_APPENGINE_CRON') == 'true'):
            log.error('Not a request from cron')
            return http.HttpResponseBadRequest()
        res = handler(request, *args, **kwargs)
        if isinstance(res, http.HttpResponse):
            return res
        else:
            return http.HttpResponse('OK')
    return handle

    Wraps a view function that is a cron handler.

    If the request does not contain the magic cron header
    from Google App Engine, a 400 response is returned.

    If the view returns a response, the response is returned.

    If the view does not return a response a basic 300 response
    is returned.

    See: https://developers.google.com/appengine/docs/python/config/cron
    
Wraps a view function that is a cron handler.
If the request does not contain the magic cron header
from Google App Engine, a 400 response is returned.

If the view returns a response, the response is returned.

If the view does not return a response a basic 300 response
is returned.


Wraps a view function that is a cron handler . If the request does not contain the magic cron header from Google App Engine a 400 response is returned . If the view returns a response the response is returned . If the view does not return a response a basic 300 response is returned .
def cronjob(handler):
    @functools.wraps(handler)
    def handle(request, *args, **kwargs):
        if (not settings.IN_DEV and
            not request.META.get('HTTP_X_APPENGINE_CRON') == 'true'):
            log.error('Not a request from cron')
            return http.HttpResponseBadRequest()
        res = handler(request, *args, **kwargs)
        if isinstance(res, http.HttpResponse):
            return res
        else:
            return http.HttpResponse('OK')
    return handle
def cronjob ( handler ) : @ functools . wraps ( handler ) def handle ( request , * args , ** kwargs ) : if ( not settings . IN_DEV and not request . META . get ( 'HTTP_X_APPENGINE_CRON' ) == 'true' ) : log . error ( 'Not a request from cron' ) return http . HttpResponseBadRequest ( ) res = handler ( request , * args , ** kwargs ) if isinstance ( res , http . HttpResponse ) : return res else : return http . HttpResponse ( 'OK' ) return handle
Wraps a view function that is a cron handler.
Wraps a view function that is a cron handler .
"""
    Wraps a view function that is a cron handler.

    If the request does not contain the magic cron header
    from Google App Engine, a 400 response is returned.

    If the view returns a response, the response is returned.

    If the view does not return a response a basic 300 response
    is returned.

    See: https://developers.google.com/appengine/docs/python/config/cron
    """
handler