<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Winn.ws &#187; Google App Engine</title>
	<atom:link href="http://winn.ws/archives/tag/google-app-engine/feed" rel="self" type="application/rss+xml" />
	<link>http://winn.ws</link>
	<description>Standards-based design &#38; development</description>
	<lastBuildDate>Sat, 28 Aug 2010 07:22:27 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Handling Web Forms Google App Engine</title>
		<link>http://winn.ws/archives/201</link>
		<comments>http://winn.ws/archives/201#comments</comments>
		<pubDate>Thu, 12 Feb 2009 18:40:40 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Google App Engine]]></category>

		<guid isPermaLink="false">http://www.winn.ws/?p=201</guid>
		<description><![CDATA[If we want users to be able to post their own greetings, we need a way to process information submitted by the user with a web form. The webapp framework makes processing form data easy.

1
2
3
4
5
6
7
8
9
10
11
class MainPage&#40;webapp.RequestHandler&#41;:
  def get&#40;self&#41;:
    self.response.out.write&#40;&#34;&#34;&#34;
      &#60;html&#62;
       [...]]]></description>
			<content:encoded><![CDATA[<p>If we want users to be able to post their own greetings, we need a way to process information submitted by the user with a web form. The webapp framework makes processing form data easy.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> MainPage<span style="color: black;">&#40;</span>webapp.<span style="color: black;">RequestHandler</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">def</span> get<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
    <span style="color: #008000;">self</span>.<span style="color: black;">response</span>.<span style="color: black;">out</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;&quot;&quot;
      &lt;html&gt;
        &lt;body&gt;
          &lt;form action=&quot;/sign&quot; method=&quot;post&quot;&gt;
            &lt;div&gt;&lt;textarea name=&quot;content&quot; rows=&quot;3&quot; cols=&quot;60&quot;&gt;&lt;/textarea&gt;&lt;/div&gt;
            &lt;div&gt;&lt;input type=&quot;submit&quot; value=&quot;Sign Guestbook&quot;&gt;&lt;/div&gt;
          &lt;/form&gt;
        &lt;/body&gt;
      &lt;/html&gt;&quot;&quot;&quot;</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>Now lets pull the data out of the post&#8230;</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> Guestbook<span style="color: black;">&#40;</span>webapp.<span style="color: black;">RequestHandler</span><span style="color: black;">&#41;</span>:
  <span style="color: #ff7700;font-weight:bold;">def</span> post<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
    <span style="color: #008000;">self</span>.<span style="color: black;">response</span>.<span style="color: black;">out</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;html&gt;&lt;body&gt;You wrote:&lt;em&gt;'</span><span style="color: black;">&#41;</span>
    <span style="color: #008000;">self</span>.<span style="color: black;">response</span>.<span style="color: black;">out</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">cgi</span>.<span style="color: black;">escape</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">request</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'content'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #008000;">self</span>.<span style="color: black;">response</span>.<span style="color: black;">out</span>.<span style="color: black;">write</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'&lt;/em&gt;&lt;/body&gt;&lt;/html&gt;'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>

<p>By using <em>self.request.get(&#8216;content&#8217;)</em> i can get the post data from the field &#8220;content&#8221;. Easy right?</p>
]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/201/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Basics of Google App Engine</title>
		<link>http://winn.ws/archives/183</link>
		<comments>http://winn.ws/archives/183#comments</comments>
		<pubDate>Tue, 03 Feb 2009 19:30:32 +0000</pubDate>
		<dc:creator>Greg Winn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Google App Engine]]></category>

		<guid isPermaLink="false">http://www.winn.ws/?p=183</guid>
		<description><![CDATA[Developing a Google App using the App engine is quick and easy! If you have a background in python then its even easier! For most of us that don&#8217;t have a lot of python in our background it becomes a little more challenging.
Our first step is to get the foundation of python so we can [...]]]></description>
			<content:encoded><![CDATA[<p>Developing a Google App using the App engine is quick and easy! If you have a background in python then its even easier! For most of us that don&#8217;t have a lot of python in our background it becomes a little more challenging.</p>
<p>Our first step is to get the foundation of python so we can work with the Google frameworks. So like most frameworks or code, we have a config/application file. This file is used to direct routes for URL&#8217;s to access many files in your application and to define a version and runtime.</p>
<p><strong>app.yaml</strong></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">application: helloworld
version: <span style="color: #ff4500;">1</span>
runtime: python
api_version: <span style="color: #ff4500;">1</span>
&nbsp;
handlers:
- url: /.<span style="color: #66cc66;">*</span>
  script: helloworld.<span style="color: black;">py</span></pre></td></tr></table></div>

<p>Now lets create the &#8220;helloworld.py&#8221; file.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
</pre></td><td class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Content-Type: text/plain'</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">''</span>
<span style="color: #ff7700;font-weight:bold;">print</span> <span style="color: #483d8b;">'Hello, world!'</span></pre></td></tr></table></div>

<p>Very similar to php using <em>print</em>.</p>
<p>Now that you have the basic files to run an application you can now start the app by clicking run on the Google app engine tool. Visit the app via &#8220;http://localhost:8080&#8243;. You should now see &#8220;Hello, world!&#8221;</p>
<blockquote><p>
I will be covering more python and Google App Engine in the coming weeks. Thanks for reading.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://winn.ws/archives/183/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced) (user agent is rejected)
Database Caching using memcached
Content Delivery Network via Amazon Web Services: CloudFront: dhbbuddo7esu2.cloudfront.net

Served from: winn.ws @ 2010-09-08 22:56:07 -->