This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
# cloud_task_delete_old_appengine_versions.py | |
This is a python file designed to operate as a Cloud Function. | |
On trigger, it will delete all but the number of non-active | |
versions equal to `RETAIN_LAST_N_VERSIONS` below (default 5). | |
Note: failure to delete will not raise an exception. If you're | |
running into bugs, see the commented line below to help debug | |
if the delete call is throwing errors |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class NonHtmlDebugToolbarMiddleware(object): | |
""" | |
The Django Debug Toolbar usually only works for views that return HTML. | |
This middleware wraps any JSON response in HTML if the request | |
has a 'debug' query parameter (e.g. http://localhost/foo?debug) | |
""" | |
@staticmethod | |
def process_response(request, response): | |
if request.GET.get('debug'): |