[英]How to run an existing Django application on aws ec2 instance?
我正在尝试在 AWS Ec2 实例上运行 Django 应用程序。 我选择了 Ubuntu 作为我的平台。 克隆 git 存储库并创建虚拟环境后,我已经在我的 requirements.txt 中安装了所有应用程序。 当我尝试以下代码python3 manage.py migrate
; python3 manage.py check
; python3 manage.py runserver
出现以下错误。
django.db.utils.OperationalError:连接到位于“localhost”(127.0.0.1)的服务器,端口 5432 失败:致命:用户“columbus_db”连接到位于“localhost”(127.0.0.1)的服务器,端口 5432 的密码验证失败失败:致命:用户“columbus_db”的密码验证失败
我的 settings.py 文件看起来像这样
DATABASES = {
# 'default': {
# 'ENGINE': 'django.db.backends.sqlite3',
# 'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
# }'default': {
'ENGINE': 'django.db.backends.postgresql_psycopg2', # Database Engine of PostgreSQL Database
'NAME': 'columbus_db', # Database Name
'USER': 'columbus_db', # Database has a Root User
'PASSWORD': 'columbus', # Database Connection Password
'HOST': "localhost", # IP Address for Localhost
}
我可以在 settings.py 或 Ec2 实例设置中更改什么以启动应用程序并在 Ec2 IP 地址看到它?
您缺少正在运行的数据库,应用程序代码除了它是 PostgreSQL,您有多种选择:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.