【发布时间】:2021-01-03 13:06:24
【问题描述】:
我正在尝试将 Django 应用程序部署到 AWS ElasticBeanStalk。
我按照标记的正确答案中的所有指南进行操作,但仍然收到以下错误:
[INFO] -----------------------Command Output-----------------------
[INFO] find: '/.platform/hooks/': No such file or directory [INFO]
------------------------------------------------------------
当我使用 Windows 操作系统时,我从 https://cocalc.com/ 在线控制台创建了我的 .sh 文件。
我还压缩了文件并使用 EBS 控制台进行部署,以避免我的文件在 git add/commit 期间被转换。
.ebextension 内容中我的配置文件是:
container_commands:
01_sh_executable:
command: "chmod +x .platform/hooks/predeploy/01_execute.sh"
我的 01_execute.sh 文件内容是:
#!/bin/bash
source /var/app/venv/*/bin/activate
cd /var/app/staging
python manage.py makemigrations
python manage.py migrate
python manage.py createsu
python manage.py collectstatic --noinp
选择的平台是在 64 位 Amazon Linux 2 上运行的 Python 3.7。我还注意到,当我运行 eb ssh 并键入 ls 时,它返回空白。 Linux 不是我的强项。
我们将不胜感激。
【问题讨论】:
标签: django amazon-web-services amazon-elastic-beanstalk python-3.7 amazon-linux-2