What will you need:
- Python 2.5+ - by default MAC OS 10 already have python installed, so actually for this one you don't have to do anything.
- Django 1.3 - a Python web framework
- MySQL - you are recommended to download the dmg
- MySQLDb - a Python-mysql connector
- Photologue - a photo management plugin for Django
- PIL - Python Imaging Library
- oauth - Python oauth library
- Massive coupon's source code
- install mysql by running the dmg package
- login to mysql by: mysql -uroot
- mysql> create database massivecoupon;
- mysql> create user 'massive'@'localhost' identified by 'coupon';
- mysql> grant all privileges on massivecoupon.* to 'massive'@'localhost';
- install every required modules by: sudo python setup.py install
- untar massive coupon's source code and then update the settings.py file accordingly
- run: python manage.py syncdb
- run: python manage.py runserver
- remove this line from massivecoupon/engine/forms.py:
from massivecoupon.libs import formutils
- go to browser and http://localhost:8000/admin
- login with the superuser credentials created before, and then setup everything
Tips for editing settings.py:
DEBUG = True
DATABASE_ENGINE = 'mysql'
DATABASE_NAME = 'massivecoupon'
DATABASE_USER = 'massive'
DATABASE_PASSWORD = 'coupon'
DATABASE_HOST = 'localhost'
DATABASE_PORT = '3306'
SESSION_COOKIE_DOMAIN = '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 setup.py install
sh: mysql_config: command not found
Traceback (most recent call last):
File "setup.py", line 15, in
metadata, options = get_config()
File "/Users/momotaro/Downloads/MySQL-python-1.2.3/setup_posix.py", line 43, in get_config
libs = mysql_config("libs_r")
File "/Users/momotaro/Downloads/MySQL-python-1.2.3/setup_posix.py", 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/base.py", 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/_mysql.so, 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/_mysql.so
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 manage.py 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: http://pypi.python.org/pypi/
Last updated: 11/04/2011
Finally can get it works, yay!!