Created
August 13, 2014 14:08
-
-
Save aaronlelevier/0577264ca4f12b754c01 to your computer and use it in GitHub Desktop.
MySQL Django settings and config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I currently use Postgres and a Mac for my Django Dev environment. However, when I first started I was using a Windows machine with MySQL. When I looked through my notes just now, it was pretty easy to set up. (I didn't use xampp however). What I installed was: | |
1. MySQL workbench: http://dev.mysql.com/downloads/workbench/ | |
2. MySQL-python connector - I used pip install for this. So if you have "pip" then it's just: | |
pip install mysql-python | |
3. And, this is what my database settings looked like in my settings.py: | |
DATABASES = { | |
'default': { | |
'ENGINE': 'django.db.backends.mysql', | |
'NAME': 'database_name', | |
'USER': 'mysql_username, | |
'PASSWORD': 'mysql_password, | |
'HOST': '127.0.0.1', | |
'PORT': '3306', | |
'OPTIONS': { | |
'read_default_file': 'my.cnf' | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks very much Aron.. I will give this a go when I get back home this evening! Hopefully it puts an end to my few days of frustration. :)
Would there be any major differences to running Postgres and Mac? (easier/more difficult etc?). I have windows and mac.