>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
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
I've go some python modules which automatically connect to the database then
they are loaded beacuse they have an __init__.py with
from django.core.management import setup_environ
import passion.settings
def loadSettings():
s = setup_environ(passion.settings)
print s
# this should only
3 matches
Mail list logo