Re: Test DB Connection

2011-10-14 Thread akshar raaj
>From what i can understand, you want to test whether you can connect to database from your django project or not. If this is your need then try the following: Go to the shell using following command: python manage.py shell On the shell, issue the following statements: from django.db import conn

Re: Test DB Connection

2011-10-14 Thread Cal Leeming [Simplicity Media Ltd]
Ja - just catch OperationalError exception and check if the code was 1044. Here are a list of all the error codes, so you can choose which ones you want to handle individually: http://dev.mysql.com/doc/refman/5.5/en/error-messages-server.html http://dev.mysql.com/doc/refman/5.5/en/error-messages