[英]How to run an existing Django application on aws ec2 instance?
I am trying to run a Django application on AWS Ec2 instance.我正在尝试在 AWS Ec2 实例上运行 Django 应用程序。 I've chosen Ubuntu as my platform.
我选择了 Ubuntu 作为我的平台。 After cloning the git repository, and creating a virtual environment, I have installed all apps in my requirements.txt.
克隆 git 存储库并创建虚拟环境后,我已经在我的 requirements.txt 中安装了所有应用程序。 When I try to the following lines of code
python3 manage.py migrate
;当我尝试以下代码
python3 manage.py migrate
; python3 manage.py check
; python3 manage.py check
; python3 manage.py runserver
the following error is coming up. python3 manage.py runserver
出现以下错误。
django.db.utils.OperationalError: connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "columbus_db" connection to server at "localhost" (127.0.0.1), port 5432 failed: FATAL: password authentication failed for user "columbus_db"
django.db.utils.OperationalError:连接到位于“localhost”(127.0.0.1)的服务器,端口 5432 失败:致命:用户“columbus_db”连接到位于“localhost”(127.0.0.1)的服务器,端口 5432 的密码验证失败失败:致命:用户“columbus_db”的密码验证失败
My settings.py file looks like this我的 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
}
What can I change in settings.py or Ec2 Instance settings to start the application and see it at Ec2 IP address?我可以在 settings.py 或 Ec2 实例设置中更改什么以启动应用程序并在 Ec2 IP 地址看到它?
You are missing a running database, the app code except it to be PostgreSQL, you have multiple choices:您缺少正在运行的数据库,应用程序代码除了它是 PostgreSQL,您有多种选择:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.