django-rest-framework/docs/examples/blogpost.rst
markotibold 304786657a Getting rid of all errors and warnings that show up when building the docs, to make a clean start with the library documentation .
--HG--
rename : docs/library/authenticators.rst => docs/library/authentication.rst
rename : docs/library/emitters.rst => docs/library/renderers.rst
2011-05-16 23:54:35 +02:00

33 lines
781 B
ReStructuredText

.. _blogposts:
Blog Posts API
==============
* http://api.django-rest-framework.org/blog-post/
The models
----------
``models.py``
.. include:: ../../examples/blogpost/models.py
:literal:
URL configuration
-----------------
``urls.py``
.. include:: ../../examples/blogpost/urls.py
:literal:
Creating the resources
----------------------
Once we have some existing models there's very little we need to do to create the corresponding resources. We simply create a base resource and an instance resource for each model we're working with.
django-rest-framework will provide the default operations on the resources all the usual input validation that Django's models can give us for free.
#``views.py``
#.. include:: ../../examples/blogpost/views.py
# :literal: