2

I try to set a Flask application in AWS EB and I am running on this issue on the Log.

Failed to find attribute 'application' in 'app'.

My application is using Application factory, so the init are set in the function.

def create_app(config_name):
    app = Flask(__name__)
    from .api.routes import api

    app.register_blueprint(api, url_prefix="/api/v1")

    from .main import main

    app.register_blueprint(main)
    app.run()
    return app

I have changed the WSGIPath to match my application name and object:

aws:elasticbeanstalk:container:python:
    NumProcesses: '1'
    NumThreads: '15'
    WSGIPath: app

My application structure looks like this:

 __init__.py(empty)
 app.py
 main.py
 requirements.txt
 api/
     __init___.py (empty)
     routes.py 

What am I missing ? I am feeling so close and so far away at the same time.

Thanks for your help.

1 Answer 1

5

Elastic beanstalk expects your app.py to be named application.py. Also, change app = Flask(__name__) to application = app = Flask(__name__)

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.