Adrest is Another Django REST. Django application for simple make HTTP REST API.
Documentation in construction.
Examples: :
from adrest.api import Api
from adrest.views import ResourceView
class BookResource(ResourceView):
allowed_methods = 'get', 'post'
model = 'books.book'
api = Api(version(1, 0, 0))
api.register(BookResource)
urlpatterns = api.urls
- python >= 2.6
- django >= 1.4.0
Adrest should be installed using pip: :
pip install adrest
Adrest settings (default values): :
# 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
Note
Add 'adrest' to INSTALLED_APPS
See test/examples in ADREST sources.
If you have any suggestions, bug reports or annoyances please report them to the issue tracker at https://github.com/klen/adrest/issues
Development of adrest happens at github: https://github.com/klen/adrest
- klen (Kirill Klenov)
Licensed under a GNU lesser general public license.