Allow embedding the code_embed page

... naturally.
This commit is contained in:
Nicolas Setton
2017-10-17 16:13:42 -04:00
parent b293481f12
commit 0d9cc70e41

View File

@@ -8,6 +8,7 @@ from django.shortcuts import render
# Create your views here.
from django.contrib.auth.models import User, Group
from django.views.decorators.clickjacking import xframe_options_exempt
from rest_framework import viewsets, status
from rest_framework.decorators import api_view
from rest_framework.response import Response
@@ -90,6 +91,7 @@ def code_page(request, example_name):
return render(request, 'code_page.html', context)
@xframe_options_exempt
def code_embed(request, example_name):
matches = Example.objects.filter(name=example_name)
if not matches: