Django 1.5.1 - Mysql - Setting

48 views
Skip to first unread message

Muhammad Ahmed

unread,
Sep 11, 2014, 1:34:41 PM9/11/14
to django...@googlegroups.com
Hi, 

I have been trying to launch my Django Model using a tutorial. but unfortunately the tutorial is about Django 1.1.

Kindly guide me that what configuration (in setting.py) will be required if I use Python27 / Django 1.5.1 with Mysql. 

please also guide towards the appropriate "MySql Adoptor" for Django 1.5.1. 


Thanks in advance :) 


Ahmed

Fred Stluka

unread,
Sep 11, 2014, 4:34:25 PM9/11/14
to django...@googlegroups.com
Ahmed,

For connecting Django to MySQL, I use MySQL-python, installed
via pip as:
    pip install MySQL-python

My settings file contains:

DATABASES = {
    'default': {
        'ENGINE'    : 'django.db.backends.mysql',
        'NAME'      : 'name of our database',
        'USER'      : 'username to access the database',
        'PASSWORD'  : 'password to access the database',
        # Required for Windows; Harmless (same as default) for Linux
        'HOST'      : '127.0.0.1',
        # Required for Windows; Harmless (same as default) for Linux
        'PORT'      : '3306',
    },

--Fred
Fred Stluka -- mailto:fr...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/881464cf-d4aa-4934-9915-3830ebafd4e6%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Muhammad Ahmed

unread,
Sep 12, 2014, 1:21:00 PM9/12/14
to django...@googlegroups.com, fr...@bristle.com, FredS...@gmail.com
Thank you very much Fred for your detailed answer. 

I have never used pip. I will be pleased if you kindly provide a reference / tutorial link to understand pip. 

Or the direct link to adapter. I am using Win7 x86. 


Thanks indeed for your help. 



On Thursday, 11 September 2014 21:34:25 UTC+5, Fred Stluka wrote:
Ahmed,

For connecting Django to MySQL, I use MySQL-python, installed
via pip as:
    pip install MySQL-python

My settings file contains:

DATABASES = {
    'default': {
        'ENGINE'    : 'django.db.backends.mysql',
        'NAME'      : 'name of our database',
        'USER'      : 'username to access the database',
        'PASSWORD'  : 'password to access the database',
        # Required for Windows; Harmless (same as default) for Linux
        'HOST'      : '127.0.0.1',
        # Required for Windows; Harmless (same as default) for Linux
        'PORT'      : '3306',
    },

Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.
On 9/11/14 9:34 AM, Muhammad Ahmed wrote:

Collin Anderson

unread,
Sep 12, 2014, 4:25:42 PM9/12/14
to django...@googlegroups.com, fr...@bristle.com, FredS...@gmail.com

Muhammad Ahmed

unread,
Sep 13, 2014, 5:04:42 AM9/13/14
to django...@googlegroups.com, fr...@bristle.com, FredS...@gmail.com
Thank you very much Collin Anderson. 

On Friday, 12 September 2014 21:25:42 UTC+5, Collin Anderson wrote:
Reply all
Reply to author
Forward
0 new messages