<?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:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
	xmlns:media="http://search.yahoo.com/mrss/"
>

<channel>
	<title>Micah Elliott &#187; django</title>
	<atom:link href="http://micahelliott.com/tag/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://micahelliott.com</link>
	<description>Stories from my Startup Journey</description>
	<lastBuildDate>Mon, 29 Nov 2010 07:46:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
<image>
  <link>http://micahelliott.com</link>
  <url>http://micahelliott.com/mde-gravatar7.png</url>
  <title>Micah Elliott</title>
</image>
	<!-- podcast_generator="podPress/8.8" - maintenance_release="8.8.6.3" -->
	<copyright>Copyright &#38;#xA9; Micah Elliott 2010 </copyright>
	<managingEditor>mde@micahelliott.com (Micah Elliott)</managingEditor>
	<webMaster>mde@micahelliott.com (Micah Elliott)</webMaster>
	<category>posts</category>
	<image>
		<url>http://micahelliott.com/wp-content/plugins/podpress/images/powered_by_podpress.jpg</url>
		<title>Micah Elliott &#187; django</title>
		<link>http://micahelliott.com</link>
		<width>144</width>
		<height>144</height>
	</image>
	<itunes:subtitle></itunes:subtitle>
	<itunes:summary>Stories from my Startup Journey</itunes:summary>
	<itunes:keywords></itunes:keywords>
	<itunes:category text="Society &amp; Culture" />
	<itunes:author>Micah Elliott</itunes:author>
	<itunes:owner>
		<itunes:name>Micah Elliott</itunes:name>
		<itunes:email>mde@micahelliott.com</itunes:email>
	</itunes:owner>
	<itunes:block>no</itunes:block>
	<itunes:explicit>no</itunes:explicit>
	<itunes:image href="http://micahelliott.com/wp-content/plugins/podpress/images/powered_by_podpress_large.jpg" />
		<item>
		<title>Send Email from a Webhost Script</title>
		<link>http://micahelliott.com/2009/02/send-email-from-a-webhost-script/</link>
		<comments>http://micahelliott.com/2009/02/send-email-from-a-webhost-script/#comments</comments>
		<pubDate>Fri, 06 Feb 2009 08:35:53 +0000</pubDate>
		<dc:creator>Micah</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[hosting]]></category>
		<category><![CDATA[howto]]></category>

		<guid isPermaLink="false">http://micahelliott.com/?p=276</guid>
		<description><![CDATA[Some webhosts make it a bit tedious to send email from your shell, and even harder inside your scripts or web apps.  But setting up Django properly enables this to become a one-liner whenever you need it. After some hunting around I found a help article at Webfaction describing the process of sending mail from [...]]]></description>
			<content:encoded><![CDATA[<p>Some webhosts make it a bit tedious to send email from your shell, and even harder inside your scripts or web apps.  But setting up Django properly enables this to become a one-liner whenever you need it.<span id="more-276"></span></p>
<p>After some hunting around I found <a href="https://help.webfaction.com/index.php?_m=knowledgebase&amp;_a=viewarticle&amp;kbarticleid=49">a help article at Webfaction</a> describing the process of sending mail from a script (with Python, nice! give it a thumbs up; those guys are great).  I could easily enough put some code like that into a function in a utility module to be called from various places, but it&#8217;s kind of ugly and repeats some data multiple times and requires a couple more imports.  On a development box I got Django&#8217;s handy <a href="http://docs.djangoproject.com/en/dev/topics/email/#topics-email">send_mail</a> function to work, but even with the described <em>smtplib</em> setup work on the webhost, the Django convenience was not going to fly.  But shortly into that Django article you see some setting parameters that are not part of the default django-admin-generated skeleton.  I tried setting these like so:</p>
<pre name="code" class="python">if platform.uname()[1].lower() == 'myserver.webfaction.com':
    EMAIL_HOST = 'smtp.webfaction.com'
    EMAIL_HOST_USER = 'my_user_name'
    EMAIL_HOST_PASSWORD = get_my_password()</pre>
<p>And now I can simply send myself emails by making calls to <em>send_mail</em>, like this:</p>
<pre name="code" class="python">from django.core.mail import send_mail
...
send_mail("New beta user signed up!",
    "%s\n%s" % (email, text),
    "beta@mycompany.com", [ADMIN])</pre>
]]></content:encoded>
			<wfw:commentRss>http://micahelliott.com/2009/02/send-email-from-a-webhost-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python Web Development Getting Started Guide</title>
		<link>http://micahelliott.com/2009/01/python-web-development-getting-started-guide/</link>
		<comments>http://micahelliott.com/2009/01/python-web-development-getting-started-guide/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 22:06:28 +0000</pubDate>
		<dc:creator>Micah</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://micahelliott.com/?p=246</guid>
		<description><![CDATA[Our front-end guru wants to take the plunge and get to know more about our middle and back (and way-back) ends.  There are more than a couple steps down the road to mastery, but the essentials are enough to get you well on your way.  This is a brief (link-farm) guide for someone with some [...]]]></description>
			<content:encoded><![CDATA[<p>Our front-end guru wants to take the plunge and get to know more about our middle and back (and way-back) ends.  There are more than a couple steps down the road to mastery, but the essentials are enough to get you well on your way.  This is a brief (link-farm) guide for someone with some programming experience, but new to <a href="http://python.org">Python</a>/<a href="http://djangoproject.com">Django</a> &#8212; heavy on my biases.  Have fun, Tim!</p>
<p><span id="more-246"></span></p>
<p>I&#8217;ll assume you&#8217;re on a Debian-based/derived system and have access to <code>apt-get</code>.  If not, you can probably install all of these by downloading individually or relying on easy_install/PyPI.</p>
<h3>Python</h3>
<p>These are the resources to get you familiar with the language, culture, and communities.  I personally like to start with books.  I&#8217;ve read many, but thanks to Python&#8217;s clean/simple design, only a couple are actually necessary to make you proficient.</p>
<p>Install: <code>sudo apt-get install python python-ipython python-setuptools</code></p>
<ul>
<li><code>python -c 'import this'</code> (Zen of Python)</li>
<li><a href="http://docs.python.org/glossary.html">Python glossary</a></li>
<li><a href="http://docs.python.org/tutorial/">Python tutorial</a></li>
<li><a href="http://docs.python.org/library/">Python Standard Library</a></li>
<li><a href="http://wiki.python.org/moin/">Python wiki</a></li>
<li><a href="http://pypi.python.org/pypi">PyPI</a></li>
<li>Book: <a href="http://www.amazon.com/Python-Nutshell-Second-OReilly/dp/0596100469/">Python in a Nutshell</a> (best Nutshell book ever written, regexes and libs coverage pretty comprehensive, but hoping for Py3k coverage soon!)</li>
<li>Alternative free/open book: <a href="http://diveintopython.org/">Dive Into Python</a></li>
<li>Book: <a href="http://www.amazon.com/Python-Cookbook-Alex-Martelli/dp/0596007973">Python Cookbook</a> (also <a href="http://code.activestate.com/recipes/langs/python/">online ASPN Cookbook</a>)</li>
<li><a href="http://www.python.org/dev/peps/pep-0008/">PEP 8</a> (style guide)</li>
<li><a href="http://www.python.org/doc/faq/programming/">Programming FAQs</a></li>
<li>Editor configuration (vim: set ts=4 ai sw=4 et tw=72; research equivalents your favorite editor; emacs good alternative)</li>
<li><a href="http://docutils.sourceforge.net/rst.html">ReStructuredText</a> (ReST)</li>
<li><a href="http://mail.python.org/mailman/listinfo/python-list">Python mailing list</a></li>
<li><a href="http://www.python.org/community/irc/">Python IRC</a></li>
<li><a href="http://wiki.python.org/moin/LocalUserGroups">Find a Python user group</a> (ours is <a href="http://wiki.python.org/moin/PortlandPythonUserGroup">Portland</a>)</li>
<li><a href="http://docs.python.org/3.0/whatsnew/3.0.html">The here/near future</a> (Python 3)</li>
</ul>
<h3>Tools</h3>
<p>If you only get one thing out of this article, let it be this: <strong>Use <a href="http://ipython.scipy.org/moin/">ipython</a> to interactively discover the language and libraries.</strong> It&#8217;s the most powerful <a href="http://en.wikipedia.org/wiki/REPL">REPL</a> of any language I&#8217;ve encountered, and is what really makes Python rise to the top for learnability.</p>
<p>Install: <code>sudo apt-get python-ipython pylint pyflakes pychecker mercurial python-nose pydb python-coverage python-sphinx</code></p>
<ul>
<li>Interactive play: <code>ipython</code> (try: <code>foo.&lt;tab&gt;</code> and <code>foo?</code> and discover everything!)</li>
<li>PyPI installables: <code>easy_install</code></li>
<li>Testing: <a href="http://somethingaboutorange.com/mrl/projects/nose/">nose</a></li>
<li>Debugging: <a href="http://bashdb.sourceforge.net/pydb/">pydb</a> (<a href="http://bashdb.sourceforge.net/pydb/features.html">extended</a> Python debugger)</li>
<li>Lint/correctness: pylint, pyflakes, pychecker</li>
<li>Code coverage: <a href="http://garethrees.org/2001/12/04/python-coverage/">python-coverage</a></li>
</ul>
<p>I&#8217;ve skipped some really useful tools that go beyond the essentials.  If you&#8217;re going to become a Python zealot, you&#8217;ll want most of your tools to be written in Python.  These might include Mercurial, Bazaar, Trac, MoinMoin, Sphinx.  We still need investigate the use of <a href="http://oreilly.com/catalog/9780596527808/">Selenium and Twill</a> for web testing.  (We&#8217;re now using <a href="http://postgresql.org">PostgreSQL</a> for all our database work for several reasons, but one of the most significant is its REPL similar in introspective capability to ipython.)</p>
<h3>Django</h3>
<p>Our choice of <a href="http://djangoproject.com">Django</a> was not an easy one, but after some time with <a href="http://pylonshq.com">Pylons</a> and <a href="http://turbogears.org">TurboGears</a> (and even RoR), it was the winner.  It&#8217;s also <a href="http://www.reddit.com/r/programming/comments/dykr/django_chosen_as_the_official_python_web">arguably sort of the official Python web framework</a> and does appear to have critical mass (<a href="http://www.google.com/search?q=django+pylons+turbogears">AFAICT</a>).  The Django website lists many of the following resources pretty clearly, but I have found these to be the most useful, and so worth enumerating here.</p>
<p>Install: <code>sudo apt-get python-django python-psycopg2 python-sqlite3</code></p>
<ul>
<li><a href="http://docs.djangoproject.com/en/dev/intro/tutorial01/">Django tutorial</a></li>
<li><a href="http://www.mercurytide.co.uk/news/article/django-cheat-sheet/">Django cheat sheet</a></li>
<li>Book: <a href="http://www.djangobook.com/">The Django Book</a> (especially chs 3-5,12)</li>
<li><a href="http://docs.djangoproject.com/en/dev/">Django documentation</a></li>
<li><a href="http://toys.jacobian.org/presentations/2007/oscon/tutorial/">Django Master Class presentation</a></li>
<li><a href="http://docs.djangoproject.com/en/dev/faq/">Django FAQs</a></li>
<li><a href="http://groups.google.com/group/django-users">Django mailing list</a></li>
<li><a href="http://docs.djangoproject.com/en/dev/topics/testing/">Testing Django page<br />
</a></li>
<li><a href="http://groups.google.com/group/django-users/browse_thread/thread/24a50006c43f43b5/eee75d48505d1af5">Long Django testing discussion</a></li>
<li><a href="http://github.com/robhudson/django-debug-toolbar/tree/master">Django Debug Toolbar</a></li>
<li>Especially informative blog: <a href="http://www.b-list.org/weblog/">B-List</a></li>
<li><a href="http://www.djangoproject.com/community/">Most Django blogs</a></li>
</ul>
<p>Please include any of your favorite resources for Python/Django newbies in the comments.</p>
]]></content:encoded>
			<wfw:commentRss>http://micahelliott.com/2009/01/python-web-development-getting-started-guide/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

