<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Steven Osborn &#187; Google App Engine</title>
	<atom:link href="http://steven.bitsetters.com/tag/google-app-engine/feed/" rel="self" type="application/rss+xml" />
	<link>http://steven.bitsetters.com</link>
	<description>"I would love to change the world, but they won't give me the source code".</description>
	<lastBuildDate>Thu, 05 Jan 2012 07:46:46 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='steven.bitsetters.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Steven Osborn &#187; Google App Engine</title>
		<link>http://steven.bitsetters.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://steven.bitsetters.com/osd.xml" title="Steven Osborn" />
	<atom:link rel='hub' href='http://steven.bitsetters.com/?pushpress=hub'/>
		<item>
		<title>Custom error pages in GAE/Django</title>
		<link>http://steven.bitsetters.com/2008/04/11/custom-error-pages-in-gaedjango/</link>
		<comments>http://steven.bitsetters.com/2008/04/11/custom-error-pages-in-gaedjango/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 13:38:37 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[Error pages]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[Goolge App Engine]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/?p=100</guid>
		<description><![CDATA[To allow for custom error pages (404,500) in Django/Google App Engine all you need is this bit of middle-ware that stubs out the request class for you so that it doesn&#8217;t blow up. Add your custom templates to your template directory and name them 404.html, 500.html etc. Paste the following into middleware/errorpages.py class DummyUser(object): def [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&amp;blog=1023260&amp;post=100&amp;subd=steve918&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>To allow for custom error pages (404,500) in Django/Google App Engine all you need is this bit of middle-ware that stubs out the request class for you so that it doesn&#8217;t blow up.</p>
<p>Add your custom templates to your template directory and name them 404.html, 500.html etc.</p>
<p>Paste the following into middleware/errorpages.py</p>
<pre>
class DummyUser(object):

    def get_and_delete_messages(self):
        pass

class NeedsUserObject(object):

    def process_request(self, request):
        request.user = DummyUser()
</pre>
<p>In your <strong>settings.py</strong> add the NeedsUserObject middleware</p>
<pre>
MIDDLEWARE_CLASSES = (
  ...
    'middleware.errorpages.NeedsUserObject',
)
</pre><br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/steve918.wordpress.com/100/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/steve918.wordpress.com/100/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/steve918.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/steve918.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/100/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/100/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/100/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&amp;blog=1023260&amp;post=100&amp;subd=steve918&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2008/04/11/custom-error-pages-in-gaedjango/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/594bd207304c33a2133a09761e4f10a3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">steve918</media:title>
		</media:content>
	</item>
		<item>
		<title>Django manage.py wrapper script for Google App Engine</title>
		<link>http://steven.bitsetters.com/2008/04/10/django-managepy-wrapper-script-for-google-app-engine/</link>
		<comments>http://steven.bitsetters.com/2008/04/10/django-managepy-wrapper-script-for-google-app-engine/#comments</comments>
		<pubDate>Fri, 11 Apr 2008 04:54:19 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/?p=98</guid>
		<description><![CDATA[I&#8217;m used to running mange.py in my Django apps and I kept forgetting the name of the Google App Engine equivalents. My script only knows how to do two things at the moment, &#8220;runserver&#8221; and &#8220;publish&#8221; but now I can manage everything the way I&#8217;m accustomed to. Update: Aprill 11 &#8211; Added toggle_debug, automatically switches [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&amp;blog=1023260&amp;post=98&amp;subd=steve918&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m used to running mange.py in my Django apps  and I kept forgetting the name of the Google App Engine equivalents.  My script only knows how to do two things at the moment, &#8220;runserver&#8221; and &#8220;publish&#8221; but now I can manage everything the way I&#8217;m accustomed to.</p>
<p><strong>Update:</strong> Aprill 11 &#8211; Added toggle_debug, automatically switches debug off when publishing and back on for development.</p>
<pre>
#!/usr/bin/env python
#
# Simple convience script for common publishing and develop tasks
# This script expects dev_appserver.py to be in your $PATH
import os, sys, re

def main(argv):

    command = ""

    try:
        command = argv[1]
    except:
        usage()
        exit(2)

    if command == 'publish':
        publish()
    elif command == 'publish-debug':
        publish(True)
    elif command == 'runserver':
        runserver()
    elif command == "--help" or command == "-h":
        usage()
        exit(0)

def usage():
    print """
    Usage: python manage.py [command] 

    Commands:
        publish - 'updates' Google App Engine with your current version
        publish-debug - 'updates' Goolge App Engine with debug turned on
        runserver - launches the development server on port 8080

    Options:
        --help, -h - Prints this screen

    For more information on a particular command, run [command] --help
    """
def get_gae_dir():
    """ Locate dev_appserver.py and return the directory is in. """

    # There's probably a smarter way to do this...
    script = 'dev_appserver.py'
    stdin, stdout = os.popen2('which %s'%script)
    xpath = stdout.read().strip()
    stdout.close()
    stdin.close()

    # If the file is a symlink, find out where the actual file lives.
    try:
        tmpdir = os.readlink(xpath)
    except OSError:
        tmpdir = xpath

    return os.path.abspath(os.path.dirname(tmpdir))

def toggle_debug(status):
    st = 'False'
    if status:
        st = 'True'

    os.rename('settings.py','settings.py.bak')
    orig = open('settings.py.bak').read()
    p = re.compile('DEBUG\s=\s(True|False)')
    n = p.sub('DEBUG = %s'%st,orig)
    nw = open('settings.py','w')
    nw.write(n)
    nw.close()

def gae_parent(script):

    DIR_PATH = get_gae_dir()
    DEV_APPSERVER_PATH = os.path.join(DIR_PATH,'google/appengine/tools/%s'%script)

    EXTRA_PATHS = [
      DIR_PATH,
      os.path.join(DIR_PATH, 'lib', 'django'),
      os.path.join(DIR_PATH, 'lib', 'webob'),
      os.path.join(DIR_PATH, 'lib', 'yaml', 'lib'),
    ]

    sys.path = EXTRA_PATHS + sys.path
    execfile(DEV_APPSERVER_PATH, globals())

def publish(debug=False):

    if(debug):
        toggle_debug(True)
    else:
        toggle_debug(False)

    sys.argv[1] = "update"
    try:
        sys.argv[2] = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
    except IndexError:
        sys.argv.append(os.path.abspath(os.path.dirname(os.path.realpath(__file__))))

    gae_parent('appcfg.py')

def runserver():
    toggle_debug(True)
    sys.argv[1] = os.path.abspath(os.path.dirname(os.path.realpath(__file__)))
    gae_parent('dev_appserver_main.py')

if __name__ == '__main__':
    main(sys.argv)
</pre><br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/steve918.wordpress.com/98/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/steve918.wordpress.com/98/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/steve918.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/steve918.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&amp;blog=1023260&amp;post=98&amp;subd=steve918&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2008/04/10/django-managepy-wrapper-script-for-google-app-engine/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/594bd207304c33a2133a09761e4f10a3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">steve918</media:title>
		</media:content>
	</item>
		<item>
		<title>Google App Engine Limitations</title>
		<link>http://steven.bitsetters.com/2008/04/09/google-app-engine-limitations/</link>
		<comments>http://steven.bitsetters.com/2008/04/09/google-app-engine-limitations/#comments</comments>
		<pubDate>Wed, 09 Apr 2008 23:57:22 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Google App Engine]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/?p=97</guid>
		<description><![CDATA[I&#8217;m really digging the concept that is Google App Engine, but I think they a little bit of work to do before I would be willing to put any effort into porting to their platform. Their marketing points for this include the fact that it allows you to build, deploy and iterate your application quickly, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&amp;blog=1023260&amp;post=97&amp;subd=steve918&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m really digging the concept that is Google App Engine, but I think they a little bit of work to do before I would be willing to put any effort into porting to their platform.  Their marketing points for this include the fact that it allows you to build, deploy and iterate your application quickly, but the fact that I have to now port just about every Python library out there to use BigTable and URL fetcher is a serious productivity loss.</p>
<ul>
<li>Python Only &#8211; This doesn&#8217;t bother me, but is still a deal breaker for a lot of people.</li>
<li>No way to schedule tasks. (cron)</li>
<li>No way to dynamically route subdomains. You can&#8217;t point *.yourdomain.com at a single script.  So your urls have to look like example.com/tulsa and not tulsa.example.com</li>
<li>You can&#8217;t use any existing libraries that make network fetches.  Google forces you to use their URL Fetcher class.  Which is broken in several ways:
<ul>
<li>No way to set timeout</li>
<li>No HTTP Auth Support</li>
<li>Does not follow redirects</li>
</ul>
</li>
<li>You have to user BigTable for your Database Layer, so you have to port any existing database code you have.  There is also no ORM for Django to use BigTable yet, which means Django Admin interface will not work.
</ul>
<p>On the bright side, their publishing and versioning process is outstanding.  The administration interface is pretty sexy so  I&#8217;ve take quite a few <a href="http://www.flickr.com/photos/14868164@N08/2400365396/in/set-72157604451691177/" target="blank"> screen shots </a> for anyone who didn&#8217;t get an invite and would like  to see it.</p>
<p><a href="http://www.flickr.com/photos/14868164@N08/2400365396/" title="Picture 1 by osborn.steven, on Flickr"><img src="http://farm3.static.flickr.com/2357/2400365396_49400a9d4f_m.jpg" width="240" height="180" alt="Picture 1" border="0" /></a></p><br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/steve918.wordpress.com/97/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/steve918.wordpress.com/97/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/steve918.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/steve918.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/97/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/97/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/97/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&amp;blog=1023260&amp;post=97&amp;subd=steve918&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2008/04/09/google-app-engine-limitations/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/594bd207304c33a2133a09761e4f10a3?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">steve918</media:title>
		</media:content>

		<media:content url="http://farm3.static.flickr.com/2357/2400365396_49400a9d4f_m.jpg" medium="image">
			<media:title type="html">Picture 1</media:title>
		</media:content>
	</item>
	</channel>
</rss>
