<?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>REVERT TO CONSOLE &#187; Django</title>
	<atom:link href="http://www.reverttoconsole.com/blog/category/django/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.reverttoconsole.com</link>
	<description>for f in *;do echo &#124; sed 'i\rtc' &#62;&#62; $f;done;</description>
	<lastBuildDate>Sat, 10 Jul 2010 12:40:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Dreamhost Django Install, Revised Edition</title>
		<link>http://www.reverttoconsole.com/blog/django/dreamhost-django-install-revised-edition/</link>
		<comments>http://www.reverttoconsole.com/blog/django/dreamhost-django-install-revised-edition/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 20:28:45 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://www.reverttoconsole.com/?p=469</guid>
		<description><![CDATA[I recently went back to doing some Django development after a long lapse, and decided to start by eating my own dogfood&#8230; I started by upgrading Python for my Dreamhost user. I followed my own post, except that I used Python 2.6 instead of 2.5. I missed one step that was caught by a pingback [...]]]></description>
			<content:encoded><![CDATA[<p>I recently went back to doing some Django development after a long lapse, and decided to start by eating my own dogfood&#8230;</p>
<p>I started by upgrading Python for my Dreamhost user. I <a href="http://www.reverttoconsole.com/blog/nix/upgrading-python-on-a-dreamhost-account/">followed my own post</a>, except that I used Python 2.6 instead of 2.5. I missed one step that was caught by a <a href="http://blog.p-for-productivity.com/?p=95">pingback post</a>:</p>
<p>In addition to the steps I outlined before:</p>
<pre class="brush: sh">
$ mkdir opt
$ mkdir downloads
$ cd downloads
$ wget http://www.python.org/ftp/python/2.6.4/Python-2.6.4.tgz
$ tar xvzf Python-2.6.4.tgz
$ cd Python-2.6.4
$ ./configure --prefix=$HOME/opt/ --enable-unicode=ucs4
$ make
$ make install
</pre>
<p>Next append </p>
<p>export PATH=$HOME/opt/bin/:$PATH</p>
<p>to your .bash_profile. Then test (from your home dir):</p>
<pre class="brush: sh">
$ source .bash_profile
$ python -V
Python 2.6.4
</pre>
<p>If you don’t see Python 2.6.4 after typing python -V then you’ve already done something wrong.</p>
<p>I had to install the Python setuptools:</p>
<pre class="brush: sh">
$ wget http://pypi.python.org/packages/2.6/s/setuptools/setuptools-0.6c9-py2.6.egg
$ sh setuptools-0.6c9-py2.6.egg
</pre>
<p>before installing Mysql-Python as before:</p>
<pre class="brush: sh">
$ wget http://downloads.sourceforge.net/project/mysql-python/mysql-python-test/1.2.3c1/MySQL-python-1.2.3c1.tar.gz
$ tar xvzf MySQL-python-1.2.2.tar.gz
$ cd MySQL-python-1.2.2
$ python setup.py install
</pre>
<p>So this brought me to the point where I had an updated version of Python on my Dreamhost account.</p>
<p>Next to set up Django.</p>
<p>I looked at setting up Django with the Dreamhost script, which didn&#8217;t seem to work for me but I don&#8217;t remember why not. In the end I found <a href="http://www.soasi.com/2008/09/django-10-on-dreamhost-with-passenger-mod_rails/">SOASI&#8217;s post</a> the most useful, although I did it a little differently.</p>
<p>First up, configure your domain.</p>
<p>In Dreamhost panel -> Domains -> Manage Domains click on the domain you want to put your app on (in the example we will set domain.com), and activate “Ruby on Rails Passenger (mod_rails)” option.</p>
<p>Create a public directory in that domain.</p>
<p>Next make sure you have your database setup. You don&#8217;t have to have a database for Django now, but if you plan to use one now is a good time to get that set up.</p>
<p>Next I downloaded and installed Django.</p>
<p>I liked the directory structure suggested by Dreamhost. This will work well for having one Django directory and use it for multiple projects on multiple domains.</p>
<pre class="brush: sh">
 /home/username/django/
   source (your django svn checkout, or skip it and use Dreamhost&#039;s site-package of Django)
   projects
   applications (any reusable applications shared between projects)
</pre>
<p>Finally, I added the media and admin media, and also the passenger_wsgi.py</p>
<pre class="brush: sh">
import sys, os
if sys.version &amp;lt; &amp;quot;2.6&amp;quot;: os.execl(&amp;quot;/home/user/opt/bin/python2.6&amp;quot;, &amp;quot;python2.6&amp;quot;, *sys.ar
gv)
sys.path.insert(1, &amp;quot;/home/user/django/source&amp;quot;)
sys.path.insert(1, &amp;quot;/home/user/django/applications&amp;quot;)
sys.path.insert(1, &amp;quot;/home/user/django/projects&amp;quot;)
os.environ[&#039;DJANGO_SETTINGS_MODULE&#039;] = &amp;quot;project.settings&amp;quot;
import django.core.handlers.wsgi
application = django.core.handlers.wsgi.WSGIHandler()
</pre>
<p>On /home/user/django/projects/myproject/settings.py file check settings:</p>
<pre class="brush: sh">
MEDIA_ROOT = &#039;/home/user/domain.com/public/media/&#039;
MEDIA_URL = &#039;http://www.domain.com/media/&#039;
ADMIN_MEDIA_PREFIX = &#039;/admin_media/&#039;
</pre>
<p>Create a symbolic link for admin_media:</p>
<pre class="brush: sh">
cd /home/user/domain.com/public/
ln -s home/user/django/source/contrib/admin/media/ admin_media
</pre>
<p>Django and Python are still new to me, so you get what you pay for with this setup.</p>
<p>Note:<br />
<a href="http://coltonprovias.com/2009/09/21/django-on-dreamhost-with-passenger/">I found this today</a>, and it looks like it could be a good setup too.</p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fdjango%2Fdreamhost-django-install-revised-edition%2F&amp;title=Dreamhost+Django+Install%2C+Revised+Edition" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://www.reverttoconsole.com/blog/django/dreamhost-django-install-revised-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Django on Dreamhost</title>
		<link>http://www.reverttoconsole.com/blog/nix/django-on-dreamhost/</link>
		<comments>http://www.reverttoconsole.com/blog/nix/django-on-dreamhost/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 15:41:25 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://reverttoconsole.com/?p=237</guid>
		<description><![CDATA[It doesn&#8217;t take much searching to suspect that Django on Dreamhost maby not be an ideal environment, but it does work. Running Django on Dreamhost involves using Fastcgi, which is officially supported by Django, but not a recommended configuration. I found following the official tutorial sufficient in setting up Django on Dreamhost. A couple of [...]]]></description>
			<content:encoded><![CDATA[<p>It doesn&#8217;t take much searching to suspect that <a href="http://www.djangoproject.com/">Django</a> on <a href="http://dreamhost.com/">Dreamhost</a> maby not be an ideal environment, but it does work. Running Django on Dreamhost involves using <a href="http://www.fastcgi.com/drupal/">Fastcgi</a>, which is officially supported by Django, but not a recommended configuration.</p>
<p>I found following <a href="http://wiki.dreamhost.com/index.php/Django">the official tutorial</a> sufficient in setting up Django on Dreamhost.</p>
<p>A couple of notes from this install:</p>
<ol>
<li>There are a several sites that mention what to do after you make code changes, and have already accessed the site. I have found that &#8220;touch ~/mysite/dispatch.fcgi&#8221; is sufficient to reload my changes. But several sites mention performing a pkill or pkill -9 python2.5.  I can see there are a couple of dispatch.fcgi processes running, but I haven&#8217;t seen a need to kill them yet, so I&#8217;m sticking with the touch command at this point.</li>
<li>I had to uncheck Extra Web Security for my Django domain in the dreamhost panel to get it to run correctly. I&#8217;ll double check this as I get development going, as it looks like others have Django running with extra web security enabled.</li>
</ol>
<p><strong>References:</strong></p>
<ul>
<li><a href="http://jeffcroft.com/blog/2006/may/11/django-dreamhost/">Jeff Croft&#8217;s Tutorial</a> provides another description of essentially the same process. Keep in mind that this is 2 years old however.</li>
<li><a href="http://blog.localkinegrinds.com/2007/03/29/my-dreamhost-django-subversion-setup/">Ryan Kanno provides a cool idea for a development cycle in this environment</a></li>
</ul>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fdjango-on-dreamhost%2F&amp;title=Django+on+Dreamhost" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://www.reverttoconsole.com/blog/nix/django-on-dreamhost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upgrading Python on a Dreamhost Account</title>
		<link>http://www.reverttoconsole.com/blog/nix/upgrading-python-on-a-dreamhost-account/</link>
		<comments>http://www.reverttoconsole.com/blog/nix/upgrading-python-on-a-dreamhost-account/#comments</comments>
		<pubDate>Sun, 28 Sep 2008 15:06:53 +0000</pubDate>
		<dc:creator>Jeff</dc:creator>
				<category><![CDATA[*NIX]]></category>
		<category><![CDATA[Django]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://reverttoconsole.com/?p=228</guid>
		<description><![CDATA[Java is just my day job. In fact, it&#8217;s pretty dull too sometimes. I like to venture out when I can and work with other technologies. In this case, I&#8217;ve been messing around with Django on my Dreamhost account. This short tutorial is intended to be the first of several related to Python and Django. [...]]]></description>
			<content:encoded><![CDATA[<p>Java is just my day job. In fact, it&#8217;s pretty dull too sometimes. I like to venture out when I can and work with other technologies. In this case, I&#8217;ve been messing around with <a href="http://www.djangoproject.com/">Django</a> on my <a href="http://www.dreamhost.com/">Dreamhost</a> account. This short tutorial is intended to be the first of several related to Python and Django.</p>
<p>Ssh to your DH account, from the base dir&#8230;</p>
<pre class="brush: sh">
$ mkdir opt
$ mkdir downloads
$ cd downloads
$ wget http://www.python.org/ftp/python/2.5.2/Python-2.5.2.tgz
$ tar xvzf Python-2.5.2.tgz
$ cd Python-2.5.2
$ ./configure --prefix=$HOME/opt/ --enable-unicode=ucs4
$ make
$ make install
</pre>
<p>If that completes correctly, you can remove the tarball and the Python2.5.2 directory.</p>
<p>Next, update your path by adding:</p>
<blockquote><p>export PATH=$HOME/opt/bin/:$PATH</p></blockquote>
<p>to your .bash_profile. Then test:</p>
<pre class="brush: sh">
$ source .bash_profile
$ python -V
Python 2.5.2
</pre>
<p>If you don&#8217;t see Python 2.5.2 after typing python -V then you&#8217;ve already done something wrong.</p>
<p>Next, update MySql-Python (from the downloads directory):</p>
<pre class="brush: sh">
$ wget http://internap.dl.sourceforge.net/sourceforge/mysql-python/MySQL-python-1.2.2.tar.gz
$ tar xvzf MySQL-python-1.2.2.tar.gz
$ cd MySQL-python-1.2.2
$ python setup.py install
</pre>
<p>Make sure the files extract into the ~/opt/lib/python2.5/site-packages/ directory as an <a href="http://peak.telecommunity.com/DevCenter/PythonEggs">egg file</a>.</p>
<p>Now that we have everything upgraded nicely, we can move on to installing Django.</p>
<p><strong>References:</strong></p>
<p><a href="http://blog.localkinegrinds.com/2007/08/20/custom-python-installation-for-django-on-dreamhost/">Custom Python Install by LocalKineGrinds</a></p>

<span class="slashdigglicious">
<a href="http://slashdot.org/bookmark.pl?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account" title="Slashdot It!"><img src="http://slashdot.org/favicon.ico" height="16" width="16" alt="[Slashdot]" /></a>
<a href="http://digg.com/submit?phase=2&amp;url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account" title="Digg This Story"><img src="http://digg.com/favicon.ico" width="16" height="16" alt="[Digg]" /></a>
<a href="http://reddit.com/submit?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account" title="Reddit"><img src="http://reddit.com/favicon.ico" width="16" height="16" alt="[Reddit]" /></a>
<a href="http://del.icio.us/post?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account" title="Save to del.icio.us" onclick="window.open('http://del.icio.us/post?v=4&amp;noui&amp;jump=close&amp;url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account', 'delicious', 'toolbar=no,width=700,height=400'); return false;"><img src="http://images.del.icio.us/static/img/delicious.small.gif" width="16" height="16" alt="[del.icio.us]" /></a>
<a href="http://www.facebook.com/share.php?u=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F" title="Share on Facebook"><img src="http://www.facebook.com/favicon.ico" width="16" height="16" alt="[Facebook]" /></a>
<a href="http://technorati.com/faves?add=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F" title="Add to my Technorati Favorites"><img src="http://technorati.com/favicon.ico" width="16" height="16" alt="[Technorati]" /></a>
<a href="http://www.google.com/bookmarks/mark?op=edit&amp;output=popup&amp;bkmk=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account" title="Save to Google Bookmarks"><img src="http://www.google.com/favicon.ico" width="16" height="16" alt="[Google]" /></a>
<a href="http://www.stumbleupon.com/submit?url=http%3A%2F%2Fwww.reverttoconsole.com%2Fblog%2Fnix%2Fupgrading-python-on-a-dreamhost-account%2F&amp;title=Upgrading+Python+on+a+Dreamhost+Account" title="Stumble it!"><img src="http://www.stumbleupon.com/favicon.ico" width="16" height="16" alt="[StumbleUpon]" /></a>
</span>]]></content:encoded>
			<wfw:commentRss>http://www.reverttoconsole.com/blog/nix/upgrading-python-on-a-dreamhost-account/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
	</channel>
</rss>
