<?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>Nerdy Dork &#187; djanog</title>
	<atom:link href="http://www.nerdydork.com/tag/djanog/feed" rel="self" type="application/rss+xml" />
	<link>http://www.nerdydork.com</link>
	<description>Dustin Davis reviews... the internet.</description>
	<lastBuildDate>Wed, 30 Jun 2010 15:52:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Basic Authentication on mod_wsgi</title>
		<link>http://www.nerdydork.com/basic-authentication-on-mod_wsgi.html</link>
		<comments>http://www.nerdydork.com/basic-authentication-on-mod_wsgi.html#comments</comments>
		<pubDate>Tue, 12 Jan 2010 00:21:05 +0000</pubDate>
		<dc:creator>Dustin</dc:creator>
				<category><![CDATA[Programming & Internet]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[basic auth]]></category>
		<category><![CDATA[djanog]]></category>
		<category><![CDATA[mod_wsgi]]></category>
		<category><![CDATA[piston]]></category>
		<category><![CDATA[wapi]]></category>
		<category><![CDATA[webfaction]]></category>
		<category><![CDATA[wsgi]]></category>

		<guid isPermaLink="false">http://www.nerdydork.com/?p=621</guid>
		<description><![CDATA[I&#8217;m currently in the process of creating an iPhone app for Inzolo. This requires an API of course. I wanted to take advantage of what was currently available for Django and I came across wapi. Time is of the essence so I decided to take the easiest route and use basic authentication for now. (I&#8217;m [...]


No related posts.

Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently in the process of creating an iPhone app for <a href="http://inzolo.com">Inzolo</a>. This requires an API of course. I wanted to take advantage of what was currently available for Django and I came across <a href="http://fi.am/entry/building-a-website-api-with-django-part-1-api-func/" class="broken_link">wapi</a>. Time is of the essence so I decided to take the easiest route and use basic authentication for now. (I&#8217;m still learning about API best practices).</p>
<p>I got some basic API calls working in my local machine running &#8220;manage.py runserver&#8221;. Once I pushed it live, the basic authentication would not work. I&#8217;m hosting with <a href="http://www.nerdydork.com/webfaction-review.html">Webfaction</a> so I <a href="http://forum.webfaction.com/viewtopic.php?id=3752">posted to the forum</a> for help and continued to look.</p>
<p>I wasn&#8217;t making progress at all so I started looking for another API framework and learned of <a href="http://bitbucket.org/jespern/django-piston/wiki/Home">Piston</a>. In hindsight I would have started here because it was developed by <a href="http://bitbucket.org">bitbucket.org</a> and it seems it will have much longer longevity.</p>
<p>In any case, while reading the docs for Piston I saw this note:</p>
<blockquote><p><strong>Note</strong>: that using <code>piston.authentication.HttpBasicAuthentication</code> with apache and mod_wsgi requires you to add the <code>WSGIPassAuthorization On</code> directive to the server or vhost config, otherwise django-piston cannot read the authentication data from  <code>HTTP_AUTHORIZATION</code> in <code>request.META</code>. See: <a href="http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPassAuthorization">http://code.google.com/p/modwsgi/wiki/ConfigurationDirectives#WSGIPassAuthorization</a>.</p></blockquote>
<p>That was the clue I needed! I added this one-liner to apache config and&#8230; still didn&#8217;t work. <img src='http://www.nerdydork.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> </p>
<p>I then went through the process of upgrading. I was running Django (1.0.2)/mod_wsgi (2.0)/Python (2.5), I upgraded to Django (1.1.1)/mod_wsgi (2.5)/Python (2.5). Now, with the &#8220;WSGIPassAuthorization On&#8221; it works.</p>


<p>No related posts.</p>
<p>Related posts brought to you by <a href='http://mitcho.com/code/yarpp/'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://www.nerdydork.com/basic-authentication-on-mod_wsgi.html/feed</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
	</channel>
</rss>
