I tried to deploy my flask app using gcloud, gunicorn. But when I wrote the app.yaml like below, it didn t work.
这里是我的 app。
runtime: python
env: flex
entrypoint: gunicorn -b :$PORT flask_todo:create_app
runtime_config:
python_version: 3
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
<>strong>inpy file
import os
from flask import Flask,render_template,request,url_for,redirect
from . import db
def create_app(test_config=None):
app = Flask(__name__, instance_relative_config=True)
app.config.from_mapping(
SECRET_KEY= dev ,
DATABASE=os.path.join(app.instance_path, flaskr.sqlite ),
)
if test_config is None:
app.config.from_pyfile( config.py , silent=True)
else:
app.config.from_mapping(test_config)
try:
os.makedirs(app.instance_path)
except OSError:
pass
return app
flask_todo #this is where I cd to and run gunicorn flask_todo:create_app
flask_todo
--db.py
--__init__.py
--app.yaml
--requirements.txt
原因何在? 请帮助我。