Java is just my day job. In fact, it’s pretty dull too sometimes. I like to venture out when I can and work with other technologies. In this case, I’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.
Ssh to your DH account, from the base dir…
[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
[/sh]
If that completes correctly, you can remove the tarball and the Python2.5.2 directory.
Next, update your path by adding:
export PATH=$HOME/opt/bin/:$PATH
to your .bash_profile. Then test:
[sh]
$ source .bash_profile
$ python -V
Python 2.5.2
[/sh]
If you don’t see Python 2.5.2 after typing python -V then you’ve already done something wrong.
Next, update MySql-Python (from the downloads directory):
[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
[/sh]
Make sure the files extract into the ~/opt/lib/python2.5/site-packages/ directory as an egg file.
Now that we have everything upgraded nicely, we can move on to installing Django.
References:
Custom Python Install by LocalKineGrinds
2 Comments
Hi there, you seem to have many posts relating to django and dreamhost. I have a dreamhost account and am running django on it. I seem to be having an issue with the pyfacebook package. If I try to add the Middleware ‘facebook.djangofb.Middleware’ it well, breaks everything, and the app never gives a response. I was wondering if you have ever had this problem, or if you could point me in a direction to solving it?
Thank you
Josh
Hi Josh, I’m far from being an expert with Django, it’s a hobby for me, not my day job.
That said, the most useful info I’ve gotten for debugging is the output in the browser.
If you’re not getting a response, then I’d be inclined to look at the installation itself- did the facebook.djangofb.Middleware actually install correctly? Did you use easyinstall and were there errors during that process? That would be where I would start. Hope that helps.
3 Trackbacks/Pingbacks
[...] Upgrade python on dreamhost (tags: howto python dreamhost django) [...]
[...] the Python version on my Dreamhost machine: 2.3.5. I decided to upgrade to a later version as per these instructions. I installed Python 2.6.2 instead of the mentioned 2.5.2. This was the latest stable version in the [...]
[...] 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 [...]
Post a Comment