地址-另一个Django休息。快速构建rest api的简单应用程序。
adrest的Python项目详细描述
Adrest是另一个django rest。简单makehttprestapi的django应用程序。
construction中的文档。
要求
- python 2.7版
- Django(1.5、1.6、1.7)
安装
adrest应使用pip:
安装pip install adrest
快速入门
from adrest import Api, ResourceView api = Api('v1') @api.register class BookResource(ResourceView): class Meta: allowed_methods = 'get', 'post' model = 'app.book' urlpatterns = api.urls
设置
地址设置(默认值):
# Enable logs ADREST_ACCESS_LOG = False # Auto create adrest access key for User ADREST_AUTO_CREATE_ACCESSKEY = False # Max resources per page in list views ADREST_LIMIT_PER_PAGE = 50 # Display django standart technical 500 page ADREST_DEBUG = False # Limit request number per second from same identifier, null is not limited ADREST_THROTTLE_AT = 120 ADREST_THROTTLE_TIMEFRAME = 60 # We do not restrict access for OPTIONS request ADREST_AUTHENTICATE_OPTIONS_REQUEST = False
注意
将“adrest”添加到已安装的应用程序中
使用地址
请参阅ADRest Sources中的测试/示例。
错误跟踪器
如果您有任何建议、错误报告或 烦恼请向问题追踪者报告 在https://github.com/klen/adrest/issues
贡献
肾上腺发育发生在github:https://github.com/klen/adrest
贡献者
- klen(基里尔·克莱诺夫)