django - YML 配置的 django elasticbeanstalk 部署问题
问题描述
出于测试目的,我正在尝试在 AWS 弹性 beantalk 中上传一个 django 项目。但是环境创建命令eb create my-env
给了我这个错误:
ERROR: InvalidParameterValueError - The configuration file .ebextensions/django.config in application version app-8036-200522_133554 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.
这是我的文件夹结构。
.
├── db.sqlite3
├── .ebextensions
│ └── django.config
├── .elasticbeanstalk
│ └── config.yml
├── .gitignore
├── manage.py
├── requirements.txt
├── static
└── TaxKH_API
├── asgi.py
├── __init__.py
├── settings.py
├── urls.py
└── wsgi.py
这是我的 .ebextensions/django.config 我已经使用在线工具验证了 YML。YML 格式化和验证没有问题。
option_settings:
aws:elasticbeanstalk:container:python:
WSGIPath: TaxAPI/wsgi.py
这是我在文件屏幕截图中没有使用任何类型的选项卡的 屏幕截图
解决方案
您必须执行以下步骤:
- 删除 django.config 中的所有选项卡并仅使用空格(缩进 2 个空格)
eb
在运行类似命令eb create
或eb deploy
反映更改之前,您必须添加更改并将更改提交到本地存储库。eb
CLI 仅从您的存储库中读取文件。
推荐阅读
- ios - 将sqlite db从我的应用程序文件夹复制到ios swift中的内置文件应用程序文件夹
- jmeter - Jmeter __RequestVerificationToken 提取问题
- python - Python:创建任务的 FastAPI 调用返回异步结果。如何?
- javascript - Javascript:错误在条件表达式中不必要地使用布尔文字 no-unneeded-ternary
- javascript - 如何在单击按钮时更改文本框的值?我想为购物车管理做这件事
- sql - 在存储过程中验证用户后返回用户信息?
- php - Laravel Lighthouse - 如何更新多个模型
- swift - 如何在结构/结构中引用结构的属性
- javascript - 从 json 数据应用的离子选择过滤器选项
- rust - 标准库中是否有完美的函数或一些推荐的方法来扩展 Rust 中的转义序列?