简体   繁体   English

AWS Elastic Beanstalk Django 配置文件异常

[英]AWS Elastic Beanstalk Django configuration file exception

I'm trying to deploy a sample Django (Python 3.6) application to AWS Elastic Beanstalk via the eb CLI tool.我正在尝试通过 eb CLI 工具将示例 Django (Python 3.6) 应用程序部署到 AWS Elastic Beanstalk。 I followed this tutorial and all is going good until I get to the YAML Django configuration file.我遵循了本教程,一切顺利,直到我进入 YAML Django 配置文件。

I'm using Sublime 3 for editing, at first I thought it had some problem with the encoding and/or tabs but then I tried with vim, copy-pasting the exact code from the tutorial and got the same error every time.我正在使用 Sublime 3 进行编辑,起初我认为它的编码和/或选项卡存在一些问题,但后来我尝试使用 vim,从教程中复制粘贴了确切的代码,但每次都遇到相同的错误。

My project structure is我的项目结构是

/
/project
/project/wsgi.py
...
$ cat .ebextensions/django.config
option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: project/wsgi.py

When I run eb deploy I get the next error:当我运行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.

Why not try the exact format as shown in tutorial.为什么不尝试教程中显示的确切格式。

option_settings:
   aws:elasticbeanstalk:container:python:
      WSGIPath: project.wsgi:application

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM