diff -r 261778de26ff -r 620f9b141567 thirdparty/google_appengine/google/appengine/tools/dev_appserver_info.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/thirdparty/google_appengine/google/appengine/tools/dev_appserver_info.py Tue Aug 26 21:49:54 2008 +0000 @@ -0,0 +1,160 @@ +#!/usr/bin/env python +# +# Copyright 2007 Google Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# + +"""CGI for displaying info about the currently running app in dev_appserver. + +This serves pages under /_ah/info/ that display information about the app +currently running in the dev_appserver. It currently serves on these URLs: + + /_ah/info/queries: + A list of datastore queries run so far, grouped by kind. Used to suggest + composite indices that should be built. + + /_ah/info/index.yaml: + Produces an index.yaml file that can be uploaded to the real app + server by appcfg.py. This information is derived from the query + history above, by removing queries that don't need any indexes to + be built and by combining queries that can use the same index. +""" + + + +import cgi +import wsgiref.handlers + +from google.appengine.api import apiproxy_stub_map +from google.appengine.datastore import datastore_pb +from google.appengine.ext import webapp +from google.appengine.tools import dev_appserver_index + + +class QueriesHandler(webapp.RequestHandler): + """A handler that displays a list of the datastore queries run so far. + """ + + HEADER = """ +
This is a list of datastore queries your app has run. You have to +make composite indices for these queries before deploying your app. +This is normally done automatically by running dev_appserver, which +will write the file index.yaml into your app's root directory, and +then deploying your app with appcfg, which will upload that +index.yaml.
+ +You can also view a 'clean' index.yaml +file and save that to your app's root directory.
+ +Times run | Query |
---|---|
%(count)s | %(query)s |