« Dynamic Length Truncate Tag | Home | Contact »
Installing Django And MySQL On MacBook Air Or OS X
By Paul Kenjora | April 15, 2008
I recently got a MacBook Air and decided to run a native Django install with MySQL. I set things up the wrong way first, then I went through and got things running the right way. OS X takes a little getting used to as it works a bit differently than typical Unix setups. Getting Django running on a MacBook Air with OS X as follows:
- Make sure you do EVERYTHING on the command line as root. Use the command "su -". If you do not then everything will install into the "/opt/local…" path vs. the "/Library…" path. Now your libraries for MySQL and Python and Django will be scattered and it will be tough to get things running right. ust use "su -" and save yourself alot of trouble.
- Install MySQL as your database. My MacBook Air has the intel chipset with OS X Version 10.5.2. So I downloaded: Mac OS X 10.5 (x86). This step is not done from the command line, simply open the downloaded file, and proceed through the steps. When you’re done you can remove all the associated icons and mounted installs from your Desktop.
- Install the Python MySQL libraries in the form of MySQLdb 1.2.2 from the command line. Download it from: mysql-python 1.2.2. You will be redirected to the download page from the previous link where you should pick MySQL-python-1.2.2.tar.gz. Save the file to your drive. Then issue the following commands on it.
- When you run the commands above there will be an error with "python setup.py install", no worries its easy to fix:
- According to Michal Kox you will need to remove the lines listed below from the _mysql.c file:
- Now run "python setup.py install" and everything will finish OK, ignore the warnings. Everything is now ready for the Django install. Download Django-0.96.1.tar.gz. Follow the instructions on the download page. Again make sure you are executing everything as root "su -". The Django page really does the best job at explaining the install steps for this part.
- One Django is installed, start the MySQL server:
- Now you’re ready to write your Django applications, a great starting point is the tutorial.
So far the combination of Django and OS X on a MacBook Air has been unbeatable. I can develop the back end from the command line while getting all the benefits of a GUI for front end graphics. Any Django developer serious about getting the most out of a system with the least effort should invest in a Mac ASAP.
More from Aware Labs
- Installing Django on Gentoo The Hard Way
- Django Tips: UTF-8, ASCII Encoding Errors, Urllib2, and MySQL
- Its Not: InnoDB, MySQL, Django, or Developer Its The Unix Admin
- Outsourcing Killed By Django And Ruby On Rails
- Everything A Django Developer Needs To Create Logins
Aware Labs Recommends
- How to install Django with MySQL on Mac OS X (Antonio Cangiano)
- Installing Django with PostgreSQL on Ubuntu (Antonio Cangiano)
- Getting Django up and running on Centos 5.2 with Apache(mod_python) and MySQL (Dougal Matthews)
Topics: Environment Setup, Tutorial | Comments
-
pkenjora
-
Howard
-
Thomas
-
Igor
-
pkenjora
-
NiKo
-
pkenjora
-
Jeff
-
Igor
-
Jeff
-
casseen
-
sean