2
我需要为用户登录创建一个REST API。如果成功,它应该返回将存储在REDIS服务器中的Secret值。我会如何去做这件事?与Tastypie一起使用REDIS
我可以用tastypie-redis-resource 0.0.9来做到这一点吗? https://pypi.python.org/pypi/tastypie-redis-resource
如果是这样你能告诉我我需要什么待办事项。
我需要为用户登录创建一个REST API。如果成功,它应该返回将存储在REDIS服务器中的Secret值。我会如何去做这件事?与Tastypie一起使用REDIS
我可以用tastypie-redis-resource 0.0.9来做到这一点吗? https://pypi.python.org/pypi/tastypie-redis-resource
如果是这样你能告诉我我需要什么待办事项。
下面是相关的源:https://github.com/tunix/tastypie-redis-resource/blob/master/tastypie_redis/resources.py
你可能想是这样的:
def obj_create(self, bundle, **kwargs):
kwargs['secret_field'] = get_new_secret_value()
return super(MyResource, self).obj_create(bundle, **kwargs)