【发布时间】:2019-12-02 02:00:42
【问题描述】:
我正在尝试通过 eb CLI 工具将示例 Django (Python 3.6) 应用程序部署到 AWS Elastic Beanstalk。我关注了this tutorial,一切都很顺利,直到我找到了 YAML Django 配置文件。
我使用 Sublime 3 进行编辑,起初我认为它的编码和/或选项卡有问题,但后来我尝试使用 vim,复制粘贴教程中的确切代码,每次都遇到相同的错误.
我的项目结构是
/
/project
/project/wsgi.py
...
$ cat .ebextensions/django.config
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: project/wsgi.py
当我运行 eb deploy 时,我得到下一个错误:
ERROR: InvalidParameterValueError - The configuration file .ebextensions/django.config in application version 2.0.0 contains invalid YAML or JSON. YAML exception: Invalid Yaml: while scanning for the next token
found character '\t' that cannot start any token
in "<reader>", line 2, column 1:
aws:elasticbeanstalk:container: ...
^
, JSON exception: Invalid JSON: Unexpected character (o) at position 0.. Update the configuration file.
【问题讨论】:
-
看起来像 vim may be betraying you。保存后,您是否尝试过为制表符配置文件?显然也支持 JSON。您可能会考虑切换到那个;无论如何,我会说这是一种更好的格式(但如果您不能信任编辑器的空格/制表符处理,那么在您的位置上,我会非常担心使用 Python)。
标签: python django amazon-web-services yaml amazon-elastic-beanstalk