<?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; Django</title>
	<atom:link href="http://steven.bitsetters.com/tag/django/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>Mon, 19 Jul 2010 21:12:45 +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://www.gravatar.com/blavatar/7bcd51a83b41e608384343eb0cd809b8?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Steven Osborn &#187; Django</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>Expandable Textareas in Django</title>
		<link>http://steven.bitsetters.com/2009/03/17/expandable-textareas-in-django/</link>
		<comments>http://steven.bitsetters.com/2009/03/17/expandable-textareas-in-django/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 07:14:39 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[jquery]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/?p=326</guid>
		<description><![CDATA[I&#8217;m probably not the first one to think of this, but when your writing long posts (like this one) it&#8217;s nice to have an expandable text area. This little hack makes use of the jQuery Textarea Resizer plugin. You&#8217;ll need to download it along with jQuery and put them somewhere in your media directory. Make [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=326&subd=steve918&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m probably not the first one to think of this, but when your writing long posts (like this one) it&#8217;s nice to have an expandable text area.  This little hack makes use of the jQuery <a href="http://plugins.jquery.com/project/TextAreaResizer">Textarea Resizer</a> plugin.  You&#8217;ll need to download it along with jQuery and put them somewhere in your media directory.</p>
<p>Make a copy of the base_site.html template in django/contrib/admin/templates/admin/base_site.html and put it in your apps local template path.</p>
<p>Add the following template block to /admin/base_site.html</p>
<pre>
{% block extrahead %}

    div.grippie {
        background:#EEEEEE url({{ MEDIA_URL }}js/textarea_resize/grippie.png) no-repeat scroll center 2px;
        border-color:#DDDDDD;
        border-style:solid;
        border-width:0pt 1px 1px;
        cursor:s-resize;
        height:9px;
        overflow:hidden;
        margin-left: 106px;
    }
    textarea {
        display:block;
        margin-bottom:0pt;
        width:95%;
        height: 20%;
    }

    $(document).ready(function() {
         $('textarea:not(.processed)').TextAreaResizer();
	});

{% endblock %}
</pre>
<p>And now you should have nice expandable text-areas that look like this one:</p>
<p><a href="http://steve918.files.wordpress.com/2009/03/picture-4.png"><img src="http://steve918.files.wordpress.com/2009/03/picture-4.png?w=300&#038;h=80" alt="Expandable Textarea" title="picture-4" width="300" height="80" class="size-medium wp-image-329" /></a></p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/326/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/326/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/326/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=326&subd=steve918&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2009/03/17/expandable-textareas-in-django/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://steve918.files.wordpress.com/2009/03/picture-4.png?w=300" medium="image">
			<media:title type="html">picture-4</media:title>
		</media:content>
	</item>
		<item>
		<title>Spent some time last night playing with &#8230;</title>
		<link>http://steven.bitsetters.com/2009/03/17/spent-some-time-last-night-playing-with/</link>
		<comments>http://steven.bitsetters.com/2009/03/17/spent-some-time-last-night-playing-with/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 16:15:24 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[star-rating]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/articles/2009/03/17/spent-some-time-last-night-playing-with/</guid>
		<description><![CDATA[Spent some time last night playing with star ratings in Django, thanks to Ryan Kanno and Leah Culver&#8217;s hard work, because it made my job incredibly easy.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=323&subd=steve918&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>Spent some time last night playing with star ratings in Django, thanks to <a href="http://blog.localkinegrinds.com/2007/10/02/displaying-stars-with-rounding-as-a-django-templatetag/">Ryan Kanno</a> and <a href="http://leahculver.com/2007/04/19/star-ratings/">Leah Culver&#8217;s</a> hard work, because it made my job incredibly easy.</p><br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/323/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/323/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/323/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=323&subd=steve918&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2009/03/17/spent-some-time-last-night-playing-with/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>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&blog=1023260&post=100&subd=steve918&ref=&feed=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/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&blog=1023260&post=100&subd=steve918&ref=&feed=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&blog=1023260&post=98&subd=steve918&ref=&feed=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/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&blog=1023260&post=98&subd=steve918&ref=&feed=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&blog=1023260&post=97&subd=steve918&ref=&feed=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/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&blog=1023260&post=97&subd=steve918&ref=&feed=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>
		<item>
		<title>Google App Engine SDK</title>
		<link>http://steven.bitsetters.com/2008/04/08/google-app-engine-sdk/</link>
		<comments>http://steven.bitsetters.com/2008/04/08/google-app-engine-sdk/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 05:59:46 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Software]]></category>
		<category><![CDATA[cloud computing]]></category>
		<category><![CDATA[google]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/?p=93</guid>
		<description><![CDATA[I just learned about Google App Engine a couple of hours ago and I have to say I&#8217;m pretty excited about what their doing. I really like the fact that they didn&#8217;t go out and try to invent their own IDE and scripting language. I&#8217;m still really reluctant to move toward cloud computing services. I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=93&subd=steve918&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I just learned about Google App Engine a couple of hours ago and I have to say I&#8217;m pretty excited about what their doing.  I really like the fact that they didn&#8217;t go out and try to invent their own IDE and scripting language.  I&#8217;m still really reluctant to move toward cloud computing services.  I still want to cling on to my hardware and OS.</p>
<p><strong>Some cool points:</strong></p>
<ul>
<li>Pure Python 2.5</li>
<li>Environment includes: Django, PyYAML, and WebOb</li>
<li><a href="http://code.google.com/appengine/docs/users/" target="_blank">Google single sign on</a>&#8230;  (Where&#8217;s my OpenID suport?)</li>
<li>Simple <a href="http://code.google.com/appengine/docs/urlfetch/" target="_blank">URL Fetch API </a>(Think cURL but easier)</li>
<li><a href="http://code.google.com/appengine/docs/datastore/" target="_blank">GQL Datastore API</a></li>
<li><a href="http://code.google.com/appengine/docs/mail/" target="blank">Mail API</a></li>
</ul><br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/steve918.wordpress.com/93/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/steve918.wordpress.com/93/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/93/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/93/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/93/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=93&subd=steve918&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2008/04/08/google-app-engine-sdk/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>
	</item>
		<item>
		<title>Framework Envy</title>
		<link>http://steven.bitsetters.com/2008/02/03/framework-envy/</link>
		<comments>http://steven.bitsetters.com/2008/02/03/framework-envy/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 18:15:29 +0000</pubDate>
		<dc:creator>steve918</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Zend Framework]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://steven.bitsetters.com/articles/2008/02/03/framework-envy/</guid>
		<description><![CDATA[I&#8217;m typically a PHP guy. I wrote my first web page using PHP3 and have created some pretty robust websites since then and for the most part it&#8217;s been a pleasure to work with. I also have a bit of experience using Zend Framework which among other things has a really strong MVC implementation, but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=75&subd=steve918&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m typically a <a href="http://php.net">PHP</a> guy.  I wrote my first web page using PHP3 and have created some pretty robust websites since then and for the most part it&#8217;s been a pleasure to work with. I also have a bit of experience using <a href="http://framework.zend.com">Zend Framework</a> which among other things has a really strong MVC implementation, but I can&#8217;t help but feel a bit left behind when I look at features of some other modern frameworks.  I&#8217;ve been playing around with <a href="http://djangoproject.com">Django</a> for a few days and a few things have occurred to me.</p>
<p><strong>Validation logic should be part of the model</strong></p>
<p>Take a look at this bit of code from Django.</p>
<pre>
# in visitor/models.py
class Visitor(models.Model):
    name = models.CharField(maxlength=30)
    email = models.EmailField(maxlength=200,blank=true)
    website = models.URLField()
    donated = models.DecimalField(max_digits=5, decimal_places=2, blank=true)
</pre>
<p>In the <a href="http://framework.zend.com/manual/en/zend.controller.html">Zend_Validator</a> is much more complex, typically happens in the controller and has no direct relationship with the data model your validating for.</p>
<pre>
$nameValidator = new Zend_Validate_StringLength(1,30);
$emailValidator = new Zend_Validate();
$emailValidator-&gt;addValidator(new Zend_Validate_StringLength(0, 200))
               -&gt;addValidator(new Zend_Validate_EmailAddress());

// Zend doesn't have a URL validation class, so we would have to
// create a custom validator that extends Zend_Validate
$website = new Custom_Validator();

// This only validates that the number is a floating point number,
// in reality we would probably have to write another custom validator
// to validate monetary values.
$donated = new Zend_Validate_Float();
</pre>
<p>The nice thing about Django is the actual database tables are created from the model.  So when you declare a name field with the maxlength of 30, your validation rules knows your fields max length because it&#8217;s based from the same one line of code the database field was created from! I&#8217;m not sure I believe building database tables from your model code is the only way to do things, but I am sure complex validation logic for models belongs in their implementation, not in the controller.</p>
<p><strong>Template inheritance rocks.</strong></p>
<p>This is sadly something I had never seen before.  Instead of having half a dozen <em>include</em> statements in each of your views you can just have on that says that it <em>extends</em> your base template.  The nice thing about this is the child view/template can override what ever portions of the base template it wants, or it can just go with what the parent has.  Django&#8217;s documentation has a really good <a href="http://www.djangoproject.com/documentation/templates/#template-inheritance">example</a> of template inheritance in action.</p>
<p><strong>An auto generated admin interface is more valuable than gold.</strong></p>
<p>Before playing with Django I watched a few screen casts to get a feel for what it was all about.  Then Django seemed like a one trick pony to me and the one trick seemed a bit lame.  I mean, auto generated <a href="http://www.djangoproject.com/documentation/tutorial02/">administration interface</a>&#8230; who cares.  Since then I&#8217;ve learned Django certainly has more than one trick up it&#8217;s sleeve and their main act is really beautiful in person.  It is honestly as robust (or more so) as any administration interface I&#8217;ve built in the past. I expected something clunky and extremely _not_ user friendly.  I really expected it to generate an admin interface that made it somewhat more convenient for programmers, but wouldn&#8217;t work for the average Joe.  Well, when they say it&#8217;s &#8220;production ready&#8221; that&#8217;s exactly what they mean. The number of hours this saves (that can be spent developing fun stuff) is extremely valuable.</p>
<p><strong>Admin scripts</strong></p>
<p>I know this will sound a bit lazy, but I don&#8217;t like having to manually create half a dozen empty folders every time I set up a new project, controller etc.  Rails and Django both do a good job of generating framework skeletons for you so you can plug away without missing a beat.</p>
<p><strong>Shell to poke at objects</strong></p>
<p>This is really a language feature and not a framework feature, but you can do some really sexy stuff inside the Django shell like insert a new visitor:</p>
<pre>
&gt;&gt;&gt; p = Visitor(name="Steven", website="http://steven.bitsetters.com")
&gt;&gt;&gt; p.save()
</pre>
<p>Or select the last five blog posts</p>
<pre>
&gt;&gt;&gt; recent = BlogPosts.all()[:5]
</pre>
<p>This makes it possible to stay in Python land forever if you wish.  No bouncing around between SQL and Python.</p>
<p><strong>Built-in development servers make getting started fun</strong></p>
<p>There is nothing like spending half an hour setting up Apache and mod_* before writing your first line of code. Django and Rails bundle a lightweight web server who&#8217;s sole purpose is to make development easy and convenient.  Unfortunately you won&#8217;t be seeing a bundled PHP based web server with your favorite PHP framework anytime soon.  Try writing one and see how far you get without things like thread support.  PHP is really more of a template language itself than a general purpose programming language.  Projects like PHP-GTK make me giggle.  Single threaded GUI applications are awsome! &lt;/sarcasm&gt;</p><br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/steve918.wordpress.com/75/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/steve918.wordpress.com/75/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/steve918.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/steve918.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/steve918.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/steve918.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/steve918.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/steve918.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/steve918.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/steve918.wordpress.com/75/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/steve918.wordpress.com/75/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/steve918.wordpress.com/75/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=steven.bitsetters.com&blog=1023260&post=75&subd=steve918&ref=&feed=1" />]]></content:encoded>
			<wfw:commentRss>http://steven.bitsetters.com/2008/02/03/framework-envy/feed/</wfw:commentRss>
		<slash:comments>2</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>
	</channel>
</rss>