Starting with Django + mysql on mac osx

## install pip

  • sudo easy_install pip

## install mysql

  • Download Mysql from http://dev.mysql.com/downloads/mysql/
  • Run the package

## Start mysql server

  • sudo /usr/local/mysql/support-files/mysql.server start

## Excecute and append to .bash_profile file in your home this line. If the file does not exist just create it

export PATH="/usr/local/mysql/bin:$PATH"

## Excecute this on the shell

source ~/.bash_profile

## Set mysql root password

/usr/local/mysql/bin/mysqladmin -u root password 'yourpasswordhere'

## Install virtual environments

sudo pip install virtualenv

## Excecute and append this line to .profile file in your home. If the file does not exist just create it.

source /usr/local/bin/virtualenvwrapper.sh

## Create a directory for virtual environments storage

mkdir ~/.virtualenvs

##Install virtualenv wrapper. It’s easier for create virtual environments (mkvirtualenv, workon, etc.)

sudo pip install virtualenvwrapper

## Excecute this line on shell

source /usr/local/bin/virtualenvwrapper.sh

##Now you can start working with virtual environments (mkvirtualenv, workon, etc.)

### Install Django

pip install django (django==x.x.x in case that you need some especific version)

## Python mysql driver

pip install myqsl-python

## If you have this error “Library not loaded: libmysqlclient.18.dylib”

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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s