This file contains hidden or 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
### Keybase proof | |
I hereby claim: | |
* I am evanbeard on github. | |
* I am evanbeard (https://keybase.io/evanbeard) on keybase. | |
* I have a public key whose fingerprint is 0428 FAF6 4974 4DEC 62ED 5CFC 4578 A4B5 963C 426B | |
To claim this, I am signing this object: |
This file contains hidden or 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
class Api::RegistrationsController < Api::BaseController | |
respond_to :json | |
def create | |
user = User.new(params[:user]) | |
if user.save | |
render :json=> user.as_json(:auth_token=>user.authentication_token, :email=>user.email), :status=>201 | |
return | |
else |
This file contains hidden or 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 | |
from django.contrib.auth.decorators import login_required | |
class AllowJSONPCallback(object): | |
"""This decorator function wraps a normal view function | |
so that it can be read through a jsonp callback. | |
Usage: | |
@AllowJSONPCallback |