My main.py file in the root folder looks like below.
app = Flask(__name__)
def configure_app(app):
app.config['SERVER_NAME'] = settings.FLASK_SERVER_NAME
app.config['SWAGGER_UI_DOC_EXPANSION'] = settings.RESTPLUS_SWAGGER_UI_DOC_EXPANSION
app.config['RESTPLUS_VALIDATE'] = settings.RESTPLUS_VALIDATE
app.config['RESTPLUS_MASK_SWAGGER'] = settings.RESTPLUS_MASK_SWAGGER
app.config['ERROR_404_HELP'] = settings.RESTPLUS_ERROR_404_HELP
def initialize_app(app):
configure_app(app)
blueprint = Blueprint('api', __name__, url_prefix='/api')
api.init_app(blueprint)
api.namespaces.pop(0) #this is to remove default namespace from swagger doc
api.add_namespace(user_namespace)
app.register_blueprint(blueprint)
def main():
initialize_app(app)
app.run(debug=settings.FLASK_DEBUG)
if __name__ == "__main__":
main()
My app.yaml file looks like below.
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT main:app
runtime_config:
python_version: 3
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
Below is the requirements.txt file.
Flask==1.0.2
flask-restplus==0.11.0
gunicorn==19.9.0
I am running GAE in a flex environment.
I followed the steps in https://cloud.google.com/appengine/docs/flexible/python/quickstart and was able to succesfully deploy the app to app engine.
When I go to the appspot link, I get 404 Errors and gcloud logs tail looks like below.
2018-09-09 01:49:00 default[20180909t113222] "GET /" 404
2018-09-09 01:49:01 default[20180909t113222] "GET /favicon.ico" 404
2018-09-09 01:49:09 default[20180909t113222] "GET /api/" 404
I tried looking for a solution but never found one that is similar to my scenario.
Any help in this very much appreciated.
Thank you.