Home:ALL Converter>django elasticbeanstalk deployment issue with YML config

django elasticbeanstalk deployment issue with YML config

Ask Time:2020-05-22T15:40:57         Author:Mahabub Elahi

Json Formatter

For testing purpose I am trying to upload a django project in AWS elastic beanstalk. But environment create command eb create my-env gives me this error :

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.

Here is my folder structure.

.
├── 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

and here is my .ebextensions/django.config I have validated the YML using online tool. There is no problem regarding YML formatting and validation.

option_settings:
  aws:elasticbeanstalk:container:python:
    WSGIPath: TaxAPI/wsgi.py

Here is a screenshot of that I am not using any type of tab in my file screenshot

Author:Mahabub Elahi,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/61950028/django-elasticbeanstalk-deployment-issue-with-yml-config
Yasser Mohsen :

You have to do the below steps:\n\n\nRemove any tabs in django.config and use spaces only (2 spaces for indentation)\nYou have to add and commit your changes to your local repo before running eb command like eb create or eb deploy to reflect the changes. eb CLI reads only the files from your repo. \n",
2020-06-02T00:29:52
yy