Forums

Embedding a pythonanywhere django page into a wix site

I'm trying to embed a django page hosted on pythonanywhere via an iframe into a Wix site. The contents of the iframe are blank. I think it has something to do with allowed hosts so I've added wix.com parastorage.com, but the iframe content is still blank.

Any ideas as to what I can do to embed this page? The Wix help desk was, well, not help-ful.

Thanks.

it might be useful to open the developer's toolbar/console in your browser to see if there are any errors. It might log some error (eg: a cross-origin issue).

Thank you. That highlighted a problem, but I'm not sure how to fix. Is this a Wix issue? or a Pythonanywhere issue? Many thanks.

Refused to display 'https://DOMAIN.pythonanywhere.com/' in a frame because it set 'X-Frame-Options' to 'sameorigin'. DOMAIN.pythonanywhere.com/ Failed to load resource: net::ERR_BLOCKED_BY_RESPONSE

x-frame options is used by servers to allow or deny the embedding of their content inside iframes:

https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options

here's how you set it from your django app:

https://docs.djangoproject.com/en/1.11/ref/clickjacking/#setting-x-frame-options-for-all-responses

Thank you Harry. Issue fixed. Appreciate all the help everyone.