Django REST Framework: Difference between revisions

From Littledamien Wiki
Jump to navigation Jump to search
(Created page with "== Source == > [http://www.django-rest-framework.org/ Django REST framework] '''Question:''' This is not part of Django itself. Are there other solutions out there? == Inst...")
 
No edit summary
Line 38: Line 38:


== Notes ==  
== Notes ==  
=== External Links ===
* [http://www.django-rest-framework.org/tutorial/quickstart/ Quickstart] - Django REST framework
=== References ===
<references />
<references />

Revision as of 18:56, 4 December 2015

Source

> Django REST framework

Question: This is not part of Django itself. Are there other solutions out there?

Installation

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

External Links

References

  1. Installation - Django REST framework