Pythonanywhere:用户'Ujwal97'@'10.0.04'拒绝访问(使用密码:YES)Django

问题描述 投票:0回答:2

我正试图通过克隆我的github在pythonanywhere上部署我的django应用程序。迁移时,我收到访问被拒绝错误后跟(使用密码:YES),这是截图,

Error Image

提前致谢 !!

django python-3.x pythonanywhere
2个回答
2
投票

在我看来,你的数据库设置是错误的。 PythonAnywhere上的数据库主机名应该类似于yourusername.mysql.pythonanywhere-services.com

检查PythonAnywhere仪表板中的Database页面以获取正确的设置。

编辑:您必须使用Django设置文件中仪表板中的主机名,用户名和密码。地址10.0.0.4表示您当前的设置文件不包含正确的设置。


1
投票

yourapp/settings.py中所述,您应该在pythonanywhere guide上配置数据库设置

DATABASES = {
  'default': {
    'ENGINE': 'django.db.backends.mysql',
    'NAME': '<your_username>$<your_database_name>',
    'USER': '<your_username>',
    'PASSWORD': '<your_mysql_password>',
    'HOST': '<your_mysql_hostname>',
  }
}

还有一个现有的post on SO可能会有所帮助

© www.soinside.com 2019 - 2024. All rights reserved.