I asked this question a few weeks ago. Today I have actually written and released a standard Django application, i.e. a fully-functional relational DB-backed (and consequently fully-functional Django admin) enabled by Google CloudSQL. The only time I had to deviate from doing things the standard Django way was to send email (had to do it the GAE way). My setup is GAE 1.6.4
, Python2.7
, Django 1.3
using the following in app.yaml
:
libraries:
- name: django
version: "1.3"
However I do need you to suggest clear actionable steps to improve to the response time of the initial request when cold of this Django app. I have a simple webapp2
web site on GAE, which does not hit the DB, and when cold the response time is of 1.56s
. The Django one, when cold, hits the DB with 2 queries (two count(*)
queries over tables containing less than 300 rows each), and the response time is of 10.73s
! Not encouraging for a home page ;)
Things that come to mind are to remove the middleware
classes I don't need and other Django-specific optimisations. However tips that improve things also from a GAE standpoint would be really useful.
N.B. I don't want this to become a discussion about the merits of going for Django on GAE. I can mention that my personal Django expertise, and resulting development productivity, did bear considerably in adopting Django as opposed to other frameworks. Moreover with CloudSQL, it's easy to move away from GAE (hopefully not!) as the Django code will work everywhere else with little (or no) modifications. Related discussions about such topic can be found here and here.
200ms
mark, which is excellent. – Kendricks