How to create or register User using django-tastypie API programmatically?
My code below kinda works, it creates the User object and saves but it doesn't save the password:

    class CreateUserResource(ModelResource):
    class Meta:
        allowed_methods = ['post']
        object_class = User
        authentication = Authentication()
        authorization = Authorization()
        include_resource_uri = False
        fields = ['username']

    def obj_create(self, bundle, request=None, **kwargs):
        try:
            bundle = super(CreateUserResource, self).obj_create(bundle, request, **kwargs)
        except IntegrityError:
            raise BadRequest('That username already exists')
        return bundle

If I add 'password' to the Meta fields then it does save the raw password but not hashing it. What am I doing wrong?
How to create or register User using django-tastypie API programmatically?
===

My code below kinda works, it creates the User object and saves but it doesn't save the password:

    class CreateUserResource(ModelResource):
    class Meta:
        allowed_methods = ['post']
        object_class = User
        authentication = Authentication()
        authorization = Authorization()
        include_resource_uri = False
        fields = ['username']

    def obj_create(self, bundle, request=None, **kwargs):
        try:
            bundle = super(CreateUserResource, self).obj_create(bundle, request, **kwargs)
        except IntegrityError:
            raise BadRequest('That username already exists')
        return bundle

If I add 'password' to the Meta fields then it does save the raw password but not hashing it. What am I doing wrong?