django consultantmichael trosen

mysqldb and python on osx

What do you do if you get the following error with loading the mysqldb driver in python:
Error loading MySQLdb module: dlopen(/Users/mrtrosen/work/virtualenvs/BuzzVote/lib/python2.6/site-packages/_mysql.so, 2): Library not loaded: libmysqlclient.18.dylib

I set the following in my bash_profile:
export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

and that fixed the issue

Continue Reading

Django-messages css styling

If you’re using django-messages to show notifications to your users, here is a decent set of css styling to make it look good:

ul.messages { text-align: center; color: #000;border:1px solid #C8DCC2; margin:0 0; }
ul.messages li { background: none; padding-left: 5px; padding-top: 8px; padding-bottom: 8px;font-size: 1.2em; }
ul.messages li.debug{ background: #EEFAEA; padding: 0.5em, 0 0.5em 0; list-style: none;}
ul.messages li.info{ ... Continue Reading

Install postgresql and postgis on osx

Install these packages :)

http://www.kyngchaos.com/software:postgres

http://www.kyngchaos.com/software/frameworks

Use the GDAL 1.8 Complete to make your life a bit easier

Continue Reading

Installing psycopg2 in virtualenv on OSX

In case you’re trying to install the postgresql python library psycopg2 on OSX Snow Leapord in a virtual env, and you get the following error:

assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed

You can install psycopg2 via the following command:
sudo env ARCHFLAGS=”-arch i386 -arch x86_64” pip install psycopg2

This will set the architecture flags correctly (removing ... Continue Reading

should you develop using javascript or not

I was browsing Hacker News It basically boils down that around 2% of all users disable javascript for their browsing.

I am under the personal belief that it is a a ... Continue Reading

MongoDB on rackspace cloud server

When setting up mongodb on a rackspace cloud server instance (running Ubuntu 10.04 LTS), after installing mongodb, you might discover that you can’t run mongo because of the following error:

mongo: error while loading shared libraries: libmozjs.so: cannot open shared object file: No such file or directory.

This seems to be a known issue, but, to get around it, ... Continue Reading

Django DUNG, an alternative to Node.js mongodb and a unix-like-os AKA NUM

I’ve heard over the past few days the Django community all abuzz over a new acronym, DUNG. DUNG, better known as Django, unix-based-os, nginx, and gunicorn, is a stack for developing and deploying Django applications.

The real questions is, why DUNG.... can’t we come up with a better acronym for what I believe ... Continue Reading

Rackspace Cloud Server Ubuntu and postgresql

I’ve started using the Rackspace cloud servers for a few clients. This afternoon I ran into an issue that, after installing postgres 8.4, it was not setup properly by apt.

The reason turns out that the Language Package is not properly setup by ubuntu karmic when rackspace creates the server instance (see: http://cloudservers.mosso.com/index.php/Ubuntu_-_Repairing_Perl_Locale_Errors).

Before doing any ... Continue Reading

Welcome!

I’ve finally updated my blog! Greg Newman graciously allowed me to use his Django blog application, hello!newman, available on github, for which I am very grateful… I foresee a drink or two being passed his way whenever our paths may cross.

I’m a huge advocate for Django, the python based web application framework, and have built my ... Continue Reading