S~cmpycon master.352422909007697761

The Console

First enable Javascript in your browser, then click on the Console tab above. The large gray square on top is the console output, and the small input line on bottom is where you type your text. If you see green Python-style banner in the output window, then everything is working.


Depending on the environment, App Engine Console may require you to log in first. You can always simply enter a statement, and if you lack authorization, App Engine Console will tell you to log in first:

<div class="stdout"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="s">&quot;hello, world&quot;</span> <span class="gt">Traceback (most recent call last):</span> File <span class="nb">&quot;&lt;stdin&gt;&quot;</span>, line <span class="m">1</span>, in <span class="n-Identifier">&lt;module&gt;</span> <span class="k">print</span> <span class="s">&quot;hello, world&quot;</span> <span class="nc">NotLoggedInError</span>: <span class="n-Identifier">Hello! Please log in to use this console</span> </pre></div>


Once you gain authorization to use the console, everything is pretty much just like a Python session. Type statements at the prompt and press Enter to submit them to Python. Press the up and down arrow keys to move through the statement history, and type clear to clear the screen.

<div class="stdout"><pre><span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="s">&quot;3 to the 33 is&quot;</span><span class="p">,</span> <span class="mf">3</span> <span class="o">**</span> <span class="mf">33</span> <span class="go">3 to the 150 is 5559060566555523</span> <span class="gp">&gt;&gt;&gt; </span><span class="kn">import</span> <span class="nn">sys</span><span class="o">,</span> <span class="nn">os</span><span class="o">,</span> <span class="nn">logging</span> <span class="gp">&gt;&gt;&gt; </span><span class="k">print</span> <span class="s">&quot;Maximum integer size:&quot;</span><span class="p">,</span> <span class="n">sys</span><span class="o">.</span><span class="n">maxint</span> <span class="go">Maximum integer size: 9223372036854775807</span> <span class="gp">&gt;&gt;&gt; </span><span class="kn">from</span> <span class="nn">google.appengine.api</span> <span class="kn">import</span> <span class="n">memcache</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">memcache</span><span class="o">.</span><span class="n">add</span><span class="p">(</span><span class="n">key</span><span class="o">=</span><span class="s">&quot;example&quot;</span><span class="p">,</span> <span class="n">value</span><span class="o">=</span><span class="n">os</span><span class="o">.</span><span class="n">environ</span><span class="p">[</span><span class="s">&quot;REMOTE_ADDR&quot;</span><span class="p">])</span> <span class="go">True</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">memcache</span><span class="o">.</span><span class="n">get</span><span class="p">(</span><span class="s">&quot;example&quot;</span><span class="p">)</span> <span class="go">&#39;;</span> <span class="gp">&gt;&gt;&gt; </span><span class="n">logging</span><span class="o">.</span><span class="n">info</span><span class="p">(</span><span class="s">&quot;My IP address is </span><span class="si">%s</span><span class="s">&quot;</span> <span class="o">%</span> <span class="n">_</span><span class="p">)</span> </pre></div>


Near the top of the page are a few options, labeled "Settings," which enable or disable optional features in App Engine Console:

  • Highlighting / No Highlighting: Change this to enable or disable syntax highlighting.
  • Teamwork Settings:
    • Flying Solo (default): Just the basic interactive Python session
    • Pastebin: Open a session with pastebin.com (shared copy-and-paste) beneath the console
    • Chatting: Open a chat and instant messaging window next to the console interface. (While this can be useful for team members to have a quick conversation, remember that the conversation is not private.)

The Dashboard

If you are like me, and you spend lots of time at the interactive Python console, you want useful links and tools handy. The Dashboard tab is a quick and easy way to manage your application's data. Essentially, it just embeds the Google-provided web management interface for your application. The dashboard has two modes of operation:

  • Development (default from the SDK): Displays the development console, from which you may browse the local datastore, or use the built-in interactive console (but why would you want to do that?)
  • Production (default from appspot.com): Displays the appspot dashboard for your application. From there, you can check your quota, change versions, or perform any other administrative tasks. You could use the datastore data viewer, however for advanced usage, consider integrating App Engine Console in your own application and using it for more advanced datastore manipulation and maintenance.
  • Analytics (only available if you configure your analytics_id in config.py): Displays the latest Google Analytics reports for your public web site (presumably hosted by App Engine).
Powered by Google App Engine
Valid HTML 4.01 Strict