Django + MySQL using MacPorts on Mac OS X 10.7

Sep 19, 2012 17:15

Installing Django and MySQL on Mac OS X 10.7 from a fresh install.

In point form, because I'm in a hurry:
  1. Log in, make sure you have admin privileges
  2. Install MacPorts
  3. Add /opt/local to the "Privacy" list in Spotlight preferences (to stop Spotlight indexing all the source and slowing down installs by a factor of three)
  4. Install the various versions of Python you expect to be using
  5. Install the various versions of pyXX-virtualenv you need
  6. Install the various versions of pyXX-virtualenvwrapper you need
  7. sudo port install mysql5 +server
  8. sudo /opt/local/lib/mysql5/bin/mysql_install_db --user=mysql
  9. sudo launchctl load -w /Library/LaunchDaemons/org.macports.mysql5.plist
  10. /opt/local/bin/mysqld_safe5
  11. /opt/local/lib/mysql5/bin/mysql_secure_installation
  12. cd /opt/local/bin ; ln -s mysql_config5 mysql_config # This gets around the Django installation crash with "EnvironmentError: mysql_config not found"
  13. select the version of Python you wish to use for this virtual environment: sudo port select --set python pythonXX
  14. mkvirtualenv Django-X.X
  15. easy_install pip
  16. pip mysql-python
  17. pip install Django==X.X
Comment here if you'd find more information useful. I'll add more detail at your request.

MySQL Setup borrowed from

django, macports, programming, mac os x, howto, mysql, python, engineers-log

Previous post Next post
Up