This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
APP_ID = '' | |
APP_SECRET = '' | |
APP_ACCESS_TOKEN = '' | |
def do_request(url, **kwargs): | |
""" Does request Facebook API request. """ | |
r = requests.get('https://graph.facebook.com/' + url, | |
params=kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.http import HttpResponse | |
ACC_HEADERS = {'Access-Control-Allow-Origin': '*', | |
'Access-Control-Allow-Methods': 'GET, POST, OPTIONS', | |
'Access-Control-Max-Age': 1000, | |
'Access-Control-Allow-Headers': '*'} | |
def cross_domain_ajax(func): | |
""" Sets Access Control request headers.""" | |
def wrap(request, *args, **kwargs): |