Django REST Framework
Jump to navigation
Jump to search
Source[edit]
Comparison with other packages[edit]
Question: This is not part of Django itself. Are there other solutions out there?
A: TastyPie
What are the differences between Django REST Framework and TastyPie? - Stackoverflow
Also, Flask has built-in REST support which is said to be able to do things that Django REST Framework can't, e.g. combine queries like http://mysite.com/api/model1/filters/api/model2/filters
Installation[edit]
Install package with pip. (markdown and django-filter are optional add-ons.)[1]
$ pip install djangorestframework $ pip install markdown # Markdown support for the browsable API. $ pip install django-filter # Filtering support
Add the rest_framework app to the project:
# settings.py
INSTALLED_APPS = (
...
'rest_framework',
)
To use the browsable REST API, add the login and logout urls:
# urls.py
urlpatterns = [
...
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
]
Notes[edit]
External Links[edit]
- Quickstart - Django REST framework
References[edit]
- ↑ Installation - Django REST framework