我有一个通过Beanstalk设置的EC2实例,但是我无法获取配置来运行迁移
我的.ebextension/django.config
option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: my_app.settings
aws:elasticbeanstalk:container:python:
WSGIPath: my_app.wsgi:application
NumProcesses: 3
NumThreads: 20
container_commands:
00_test_output:
command: "echo 'testing.....'"
01_migrate:
command: "python manage.py migrate"
leader_only: true
检查日志后说
Invalid HTTP_HOST header: '52.37.179.147'. You may need to add '52.37.179.147' to ALLOWED_HOSTS.
Invalid HTTP_HOST header: '172.31.0.249'. You may need to add '172.31.0.249' to ALLOWED_HOSTS.
现在,即使我将这些IP添加到我的settings.py中的ALLOWED_HOSTS中,问题仍然存在。我在这里四处搜寻,但找不到这个特定问题的答案
没有迁移命令,我的服务器已成功构建并正在运行。
任何人都知道为什么吗?
编辑:
添加更多信息:
当我提交到github后运行eb deploy
时,出现如下错误
2020-06-03 03:45:10 ERROR [Instance: i-05f872f7e96ccd26d] Command failed on instance. An unexpected error has occurred [ErrorCode: 0000000001].
2020-06-03 03:45:11 INFO Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
2020-06-03 03:45:11 ERROR Unsuccessful command execution on instance id(s) 'i-05f872f7e96ccd26d'. Aborting the operation.
2020-06-03 03:45:11 ERROR Failed to deploy application.
然后我进入web.stdout.log
以查找那些allowed_host错误。再说一次,在另一篇文章中,由于它们是AWS ip,因此似乎并没有添加这些ip的帮助。
我无法从cloudwatch找到其他错误日志。这似乎是唯一的嫌疑犯
[C0只说
eb-engine.log
所以我知道
Error occurred during build: Command 01_migrate failed
起作用了.....
我有一个通过Beanstalk设置的EC2实例,但是我无法获取配置来运行迁移。我的.ebextension / django.config option_settings:aws:elasticbeanstalk:application:environment:...
echo
添加到您的mysqlclient
。requirements.txt
packages:
yum:
python3-devel: []
mariadb-devel: []
max_length
sv-sing进入我的ec2实例时发现了venv采购路径。
对于那些在option_settings:
aws:elasticbeanstalk:application:environment:
DJANGO_SETTINGS_MODULE: my_app.settings
aws:elasticbeanstalk:container:python:
WSGIPath: my_app.wsgi:application
NumProcesses: 3
NumThreads: 20
container_commands:
00_test_output:
command: "echo 'testing.....'"
01_migrate:
command: "source /var/app/venv/staging-LQM1lest/bin/activate && python3 manage.py migrate --noinput"
leader_only: true
中找不到有用信息的人,请通过SSH进入您的EC2实例(如果正在使用它,然后检查eb logs
] >>