We help IT Professionals succeed at work.
Get Started

django - add iframe element containing source url of my web page inside another site

1,690 Views
Last Modified: 2015-03-06
I want to add iframe with source url of my own a web page - inside another site page.

but my page is not being displayed inside the iframe, I'm getting error in the browser console:
Refused to display 'http://my.site.com/page/' in a frame because it set 'X-Frame-Options' to 'SAMEORIGIN'.

I've tried to set django x-frame-options, and this is my view:
from django.views.decorators.clickjacking import xframe_options_exempt

@xframe_options_exempt
def ok_to_load_in_a_frame(request):
    return render_to_response('test.html', {},  context_instance=RequestContext(request))

but it doesn't work for some reason... any idea?

thanks.
Comment
Watch Question
Commented:
This problem has been solved!
Unlock 1 Answer and 4 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE