I want to use my python file, which consists of some classes in my app engine. This file is present in the root directory. When I import that file into main.py, my application is not starting - I'm getting an error:
"Error: Server Error The server encountered a temporary error and could not complete your request. Please try again in 30 seconds."
Should I set any environment variables?
How I can import and call other functions which I already have written.
app.yaml
runtime: python
env: flex
runtime_config:
python_version: 3
entrypoint: gunicorn -b:$PORT --workers 2 main:app
manual_scaling:
instances: 1
resources:
cpu: 1
memory_gb: 0.5
disk_size_gb: 10
main.py
from flask import Flask
import sample
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello Everyone!'
@app.route('/sample')
def foo():
return sample.Sample()
sample.py
def Sample():
return "hello world"
requirements.txt
Flask==1.1.1
gunicorn==19.3.0
I tested this files on my local, it worked fine and also deployed on Google Cloud, it is working fine there too. Since it is flex environment which takes time to boot as compared to GAE standard environment ref doc Give sometime and try again.