All,
I tried hosting my webpages on tuxfux.pythonanywhere.com . I used the default mysql entries from pythonanywhere site.
DATABASES = {
# development
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }
# ## production
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME':'tuxfux$batch206',
'USER':'tuxfux',
'PASSWORD':'root',
'HOST': 'tuxfux.mysql.pythonanywhere-services.com',
'PORT':'' # 3306
}
}
when i am doing "python manage.py migrate" i am getting the following errors.
File "/home/tuxfux/myenv/local/lib/python2.7/site-packages/MySQLdb/__init__.py", line 86, in Connect
return Connection(*args, **kwargs)
File "/home/tuxfux/myenv/local/lib/python2.7/site-packages/MySQLdb/connections.py", line 204, in __init__
super(Connection, self).__init__(*args, **kwargs2)
django.db.utils.OperationalError: (1045, "Access denied for user 'tuxfux'@'10.0.0.212' (using password: YES)")
On doing nslookup on tuxfux.mysql.pythonanywhere-services.com i found out this is resolving to a different ip - 10.0.0.115
(myenv) 02:48 ~/src $ nslookup tuxfux.mysql.pythonanywhere-services.com
Server: 127.0.0.1
Address: 127.0.0.1#53
Non-authoritative answer:
tuxfux.mysql.pythonanywhere-services.com canonical name = users-mysql-5.machines.pythonanywhere-
services.com. users-mysql-5.machines.pythonanywhere-services.com canonical name = live-users-db-5.clt1czfvlzlc.us-east-1.rds.amazonaws.com. live-users-db-5.clt1czfvlzlc.us-east-1.rds.amazonaws.com canonical name = ec2-52-202-199-231.compute-1.amazonaws.com. Name: ec2-52-202-199-231.compute-1.amazonaws.com Address: 10.0.0.155
On further changing my setting file DATABASE to the ip - 10.0.0.115 its giving a syntax error.
__import__(name)
File "/home/tuxfux/src/mysite/settings/init.py", line 1, in <module> from .base import * File "/home/tuxfux/src/mysite/settings/base.py", line 105 'HOST':10.0.0.155, ^ SyntaxError: invalid syntax
can anyone please provide me some insite on this.