Python Django eb部署错误消息
当我将Django项目部署到AWS Elastic Beanstalk时,我收到了以下错误。不过,在本地主机上一切正常Python Django eb部署错误消息,python,django,amazon-web-services,amazon-elastic-beanstalk,Python,Django,Amazon Web Services,Amazon Elastic Beanstalk,当我将Django项目部署到AWS Elastic Beanstalk时,我收到了以下错误。不过,在本地主机上一切正常 Creating application version archive "app-160505_232739". Uploading: [##################################################] 100% Done... INFO: Environment update is starting.
Creating application version archive "app-160505_232739".
Uploading: [##################################################] 100% Done...
INFO: Environment update is starting.
INFO: Deploying new version to instance(s).
ERROR: [Instance: i-c5493f58] Command failed on instance. Return code: 1 Output: (TRUNCATED)..., level)
File "<frozen importlib._bootstrap>", line 2254, in _gcd_import
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2224, in _find_and_load_unlocked
ImportError: No module named 'storages'.
container_command 01_migrate in .ebextensions/03_python.config failed. For more detail, check /var/log/eb-activity.log using console or EB CLI.
INFO: Command execution completed on all instances. Summary: [Successful: 0, Failed: 1].
ERROR: Unsuccessful command execution on instance id(s) 'i-c5493f58'. Aborting the operation.
ERROR: Failed to deploy application.
01_migrate:
command: "python mooove_eb/manage.py migrate --noinput"
leader_only: true
02_collectstatic:
command: "python mooove_eb/manage.py collectstatic --noinput"
leader_only: true
错误消息表明您缺少
存储
模块。发件人:
01_migrate:
command: "python mooove_eb/manage.py migrate --noinput"
leader_only: true
02_collectstatic:
command: "python mooove_eb/manage.py collectstatic --noinput"
leader_only: true
Elastic Beanstalk使用to requirements.txt确定在运行应用程序的EC2实例上安装哪个包
01_migrate:
command: "python mooove_eb/manage.py migrate --noinput"
leader_only: true
02_collectstatic:
command: "python mooove_eb/manage.py collectstatic --noinput"
leader_only: true
您需要创建一个名为requirements.txt
的文件并添加行
01_migrate:
command: "python mooove_eb/manage.py migrate --noinput"
leader_only: true
02_collectstatic:
command: "python mooove_eb/manage.py collectstatic --noinput"
leader_only: true
storages==<your storages version>
存储==
您可以运行
pip freeze
查看您在开发环境中使用的版本。同意。Django在尝试运行migrate
命令时无法引导。我必须在打开virtualenv和关闭virtualenv的情况下运行pip freeze>requirements.txt一次,然后将它们组合在一起。成功了!!谢谢你的帮助!
01_migrate:
command: "python mooove_eb/manage.py migrate --noinput"
leader_only: true
02_collectstatic:
command: "python mooove_eb/manage.py collectstatic --noinput"
leader_only: true