Created
March 15, 2011 02:04
-
-
Save mgrouchy/870197 to your computer and use it in GitHub Desktop.
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.auth.models import User | |
from django.shortcuts import get_object_or_404 | |
#this view would be publicly accessable | |
def hook(request, username=None): | |
user = get_object_or_404(User, username=username) #cant remember the syntax | |
if not isinstance(User, user): | |
return user #this returns a 404 | |
#now we know what user we are dealing with | |
#so we do something with the data github just posted to us | |
data = request.POST.get('payload') | |
data = json.dumps(data) #or simplejson if necessecary | |
#do something with the data | |
return HttpResponse("OK") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment