Simon Willison’s Weblog

Subscribe

Django (web framework): What are the Best Practice For Displaying another Website from yours?

1st December 2012

My answer to Django (web framework): What are the Best Practice For Displaying another Website from yours? on Quora

This isn’t really a Django-specific question—the answer would be the same no matter what server-side tech you use.

The problem with iframes is that some websites have frame-busting JavaScript to prevent then from being framed. It’s not possible to detect this, so it’s always possible that a site you try to iframe will break your page.

A better alternative is to show a rendered preview image of the page. This is very tricky to implement (PhantomJS is a good starting point) but there are web services that can solve this for you for a fee—like http://www.url2png.com

This is Django (web framework): What are the Best Practice For Displaying another Website from yours? by Simon Willison, posted on 1st December 2012.

Next: How do I really learn coding?

Previous: What are some good ways to insult an Information Architect?