Installing Massive Coupon on Mac OS 10

What will you need:

  1. Python 2.5+ - by default MAC OS 10 already have python installed, so actually for this one you don't have to do anything.
  2. Django 1.3 - a Python web framework
  3. MySQL - you are recommended to download the dmg
  4. MySQLDb - a Python-mysql connector
  5. Photologue - a photo management plugin for Django
  6. PIL - Python Imaging Library
  7. oauth - Python oauth library
  8. openid.consumer
  9. Massive coupon's source code
Installation steps:
  1. install mysql by running the dmg package
  2. login to mysql by: mysql -uroot
  3. mysql> create database massivecoupon;
  4. mysql> create user 'massive'@'localhost' identified by 'coupon';
  5. mysql> grant all privileges on massivecoupon.* to 'massive'@'localhost';
  6. install every required modules by: sudo python install
  7. untar massive coupon's source code and then update the file accordingly
  8. run: python syncdb
  9. run: python runserver
  10. remove this line from massivecoupon/engine/
    from massivecoupon.libs import formutils
  11. go to browser and http://localhost:8000/admin
  12. login with the superuser credentials created before, and then setup everything

Tips for editing

DEBUG = True

DATABASE_NAME = 'massivecoupon'
DATABASE_USER = 'massive'
DATABASE_HOST = 'localhost'


Upon these installation steps, below are the errors that you are more likely going to encounter:

momotaro:MySQL-python-1.2.3 momotaro$ sudo python install
sh: mysql_config: command not found
Traceback (most recent call last):
File "", line 15, in
metadata, options = get_config()
File "/Users/momotaro/Downloads/MySQL-python-1.2.3/", line 43, in get_config
libs = mysql_config("libs_r")
File "/Users/momotaro/Downloads/MySQL-python-1.2.3/", line 24, in mysql_config
raise EnvironmentError("%s not found" % (mysql_config.path,))
EnvironmentError: mysql_config not found

> ln -s /usr/local/mysql/bin/* /usr/bin

File "/Library/Python/2.6/site-packages/django/db/backends/mysql/", line 14, in
raise ImproperlyConfigured("Error loading MySQLdb module: %s" % e)
django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: dlopen(/Users/momotaro/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/, 2): Library not loaded: libmysqlclient.18.dylib
Referenced from: /Users/momotaro/.python-eggs/MySQL_python-1.2.3-py2.6-macosx-10.6-universal.egg-tmp/
Reason: image not found

> sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib
> sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql

  • It is very important to install every required python modules completely, otherwise the applications won't run at all.
  • Need to stop and re-run the runserver after every installation of modules
  • It's also required to create a soft link from /var/www/massivecoupon to the real path of the massivecoupon folder itself, and then modify the permission of that folder to the proper user for rwx.
  • For any absence of modules you can try searching on this website:

Last updated: 11/04/2011
Finally can get it works, yay!!

3 comments: (+add yours?)

Pete said...

Making the symbolic link on the lbmysqlclient.18.dylib just fixed a problem I've had for hours... thank you so much!!!

Anonymous said...

Excellent advice! Same as Pete adding that symbolic link made all the difference.

wspruijt said...

Thanks a lot, searched hours for this.