"Building an App" on Cloud Showing "Internal Server Error"

I am following a guide https://cloud.google.com/appengine/docs/standard/python3/building-app
"Building an App". I have tested it in my local environment, the app is running fine. I then deployed it to the cloud. The App is working only when I remove the part of printing timestamp in index.html. Showing timestamp which is retrieved from datastore causes internal server error. Since my local test is fine, the error is not due to the app. Any clue how to get "Building an App" running on cloud?