Forums

Can't embed flask web app in google sites

I'm not able to embed my flask web app in google sites.

I've tried the following, which adds some headers using talisman, but it still doesn't work:

# A very simple Flask Hello World app for you to get started with...

from flask import Flask
from flask_talisman import Talisman, ALLOW_FROM

app = Flask(__name__)
talisman = Talisman(app)

@app.route('/')
@talisman (
    frame_options='ALLOW-FROM',
    frame_options_allow_from='*',
)
def hello_world():
    return 'This is a site on Flask!'

On the google site side, it says the URL is invalid and it will display it as a link. When I click the link, it works, so the issues appears to be that it is not able to embed it.

Any idea what I might be doing wrong? Is there a setting somewhere else to allow my webapp to be embeddable?

What kind of url did you use? Do you have access to some logs that you could share with us?

This is my website: https://chenglim.pythonanywhere.com/

As you can see, it is working. To see the problem, you'll need to have a google account and create a web site using Google Sites. Google Sites has a full page embed feature, so just try to create a full page embed, providing the URL that I have given. It will display the website if it works. If not, it just shows a link.

Here's a nice article describing the full page embed: https://www.techrepublic.com/article/how-to-embed-full-page-content-in-google-sites/.

Unfortunately, I don't think I have access to any logs other than what is displayed in the UI.

I hope that's enough to help out. It would be so nice to be able to embed the web site.

Since it's on the Google Sites side, we don't have ability to debug the issue -- did you try to ask their support?