First steps with Pinax

Thursday, 4th June, 2009

Pinax is a web development platform built on top of Django (which is a web development framework). The point of Pinax seems to be that it gathers together and integrates a collection of django applications into one package. You install Pinax and all of a sudden you have a fully functioning ‘default’ social networking website.

Preliminaries for Mac OS X

python-mysql

I’m going to use MySQL with Django. So I need MySQL itself, and the python-mysql interface, python-mysql. If you install mysql and python-mysql from fink, this section may not be necessary.

I installed the Mac OS X MySQL from mysql.com. This meant that the python-mysql from fink didn’t work (it didn’t find mysql & started installing its own). Installing python-mysql from sourceforge didn’t work either: I got a compile error similar to this:

/usr/include/sys/types.h:92: error: duplicate ‘unsigned’
/usr/include/sys/types.h:92: error: two or more data types in declaration specifiers 

From MangoOrange I found the following advice:

Step 4:
In the same folder, edit _mysql.c using your favourite text-editor

4a. Remove the following lines (37-39):

#ifndef uint
#define uint unsigned int
#endif

4b. Change the following:

uint port = MYSQL_PORT;
uint client_flag = 0;

to

unsigned int port = MYSQL_PORT;
unsigned int client_flag = 0;

After a precautionary sudo python setup.py clean, python-mysql will now install with the specified sudo python setup.py install.

PIL

For photo support (e.g. uploading photos to your Pinax homepage), Pinax uses the Python Imaging Library. fink installs PIL to /sw/lib/python2.5/site-packages/PIL/ where MacOSX’s own python can’t find it. I got PIL source from http://www.pythonware.com/products/pil/ and installed that using sudo python setup.py install.

Pinax: install and set up

There’s very little to write here. I followed the instructions and everything worked, …

… except the Locations page in the resulting website. Even here though it showed a very helpful Django error page:

  Exception Type:  	ImproperlyConfigured
  Exception Value:
 	django-locations requires a valid YAHOO_MAPS_API_KEY setting.
   	Please register for a key at https://developer.yahoo.com/wsregapp/
   	and then insert your key into the settings file.

Doesn’t look like I need to worry about that for now. If I want Locations I’ll go get a key, otherwise I’ll uninstall Locations.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: