forked from django-nonrel/djangoappengine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathviews.py
More file actions
17 lines (16 loc) · 626 Bytes
/
views.py
File metadata and controls
17 lines (16 loc) · 626 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
from django.conf import settings
from django.http import HttpResponse
from django.utils.importlib import import_module
def warmup(request):
"""
Provides default procedure for handling warmup requests on App Engine.
Just add this view to your main urls.py.
"""
for app in settings.INSTALLED_APPS:
for name in ('urls', 'views', 'models'):
try:
import_module('%s.%s' % (app, name))
except ImportError:
pass
content_type = 'text/plain; charset=%s' % settings.DEFAULT_CHARSET
return HttpResponse('Warmup done', content_type=content_type)