<?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>yken.org &#187; corporatepoems.com</title>
	<atom:link href="http://yken.org/tag/corporatepoems-com/feed/" rel="self" type="application/rss+xml" />
	<link>http://yken.org</link>
	<description>...it depends</description>
	<lastBuildDate>Sun, 07 Mar 2010 17:47:59 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Google App Engine &#8211; the first experiences</title>
		<link>http://yken.org/2010/01/26/google-app-engine-the-first-experiences/</link>
		<comments>http://yken.org/2010/01/26/google-app-engine-the-first-experiences/#comments</comments>
		<pubDate>Tue, 26 Jan 2010 22:36:52 +0000</pubDate>
		<dc:creator>ikendra</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[corporatepoems.com]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://yken.org/?p=334</guid>
		<description><![CDATA[A few days ago, I started to work on the corporatepoems.com website. The web is a fun pet project, an idea born somewhere in a pub after a few beers &#8211; I will write about the idea a bit later. Today, I just wanted to briefly comment on two problems which I encountered during my [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago, I started to work on the <a href="http://www.corporatepoems.com/">corporatepoems.com</a> website. The web is a fun pet project, an idea born somewhere in a pub after a few beers &#8211; I will write about the idea a bit later. Today, I just wanted to briefly comment on two problems which I encountered during my first steps with the App Engine.<br />
<span id="more-334"></span></p>
<h5>Occasional blank pages</h5>
<p>If you see a blank page when refreshing your app in a browser after a source code update, be it on your local machine or after the upload to Google, but then with any subsequent refresh the page appearing just fine, check the Python script executed for given URL (see your <code>app.yaml</code>) to make sure that you are invoking the main() function correctly, i.e. something like the notorious</p>
<pre>
if __name__ == '__main__':
	main()
</pre>
<p>If you make a typo in the above snippet or should you omit it completely, you will experience the problem above.</p>
<p><b>Update:</b> See the comments below this article for explanation of the reason of this behavior.</p>
<h5>Static files: CSS not loading</h5>
<p>At some stage of working on the project I introduced the CSS style sheet for the site: added a <code>static_dir</code> to <code>handlers</code> section of the <code>app.yaml file</code> and then created the CSS file and stored it in the directory referred to by <code>static_dir</code>. Then, I simply referenced the CSS file in the HTML. So my <code>app.yaml</code> looked like</p>
<pre>
application: corporatepoems
version: 5
runtime: python
api_version: 1

handlers:
- url: /css
  static_dir: css

- url: /.*
  script: corporatepoems.py
</pre>
<p>&#8230;and the HTML contained:</p>
<pre>
&lt;link rel="stylesheet" href="/css/corporatepoems.css" type="text/css" media="screen" /&gt;
</pre>
<p>However, the CSS would not load. I double checked the file and directory names, all was correct. The fix to the problem was to actually increase (or chage) the application <code>version</code> in the <code>app.yaml</code> file. After that, CSS loaded as expected. The explanation to this could be that I perhaps forgotten to save the <code>app.yaml</code> file after adding the <code>static_dir</code> at first place, but I&#8217;m pretty sure this was not the case. After the fix, I never saw the problem again.</p>
<p>All in all, working with Google App Engine and Python feels great so far, thanks Filip for your suggestion to give it a try! To be continued. </p>
]]></content:encoded>
			<wfw:commentRss>http://yken.org/2010/01/26/google-app-engine-the-first-experiences/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
