I need to pull data from an external MySQL database to my application. I have added the below lines to my databases dictionary in settings.py file.
'cust': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'cust_data',
'HOST': '',
'USER': '',
'PASSWORD': ''
}
Is the engine name right? I have added all other details.
Now is this it? How can I get the data from this database now? Can I simply use an SQL query in my applications views.py?
Now when I enter shell using below command
python manage.py shell
When I execute a query to the MySQL database, it doesn't work. I am sure I am missing something here.
I am stuck here, what am I doing wrong here? How can I run a command to access data from a particular table in the above DB?