mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-02-27 17:00:45 +03:00
some more refactoring and some style enhancements. Just committing
to stay in sync.
This commit is contained in:
parent
1b28339e5b
commit
abf0ee8b97
9
docs/contents.rst
Normal file
9
docs/contents.rst
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
Documentation
|
||||||
|
=============
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 2
|
||||||
|
|
||||||
|
library
|
||||||
|
examples
|
||||||
|
|
|
@ -1,9 +1,23 @@
|
||||||
|
Examples
|
||||||
|
========
|
||||||
|
|
||||||
|
There are a few real world web API examples included with Django REST framework.
|
||||||
|
|
||||||
|
#. :doc:`examples/objectstore` - Using :class:`views.View` classes for APIs that do not map to models.
|
||||||
|
#. :doc:`examples/pygments` - Using :class:`views.View` classes with forms for input validation.
|
||||||
|
#. :doc:`examples/blogpost` - Using :class:`views.ModelView` classes for APIs that map directly to models.
|
||||||
|
|
||||||
|
All the examples are freely available for testing in the sandbox:
|
||||||
|
|
||||||
|
http://rest.ep.io
|
||||||
|
|
||||||
|
(The :doc:`examples/sandbox` resource is also documented.)
|
||||||
|
|
||||||
|
Example Reference
|
||||||
|
-----------------
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:maxdepth: 1
|
||||||
|
:glob:
|
||||||
|
|
||||||
examples/views
|
examples/*
|
||||||
examples/modelviews
|
|
||||||
examples/objectstore
|
|
||||||
examples/pygments
|
|
||||||
examples/blogpost
|
|
||||||
examples/sandbox
|
|
||||||
|
|
|
@ -70,6 +70,13 @@ Getting Started
|
||||||
|
|
||||||
Using Django REST framework can be as simple as adding a few lines to your urlconf.
|
Using Django REST framework can be as simple as adding a few lines to your urlconf.
|
||||||
|
|
||||||
|
The following example exposes your `MyModel` model through an api. It will provide two views:
|
||||||
|
|
||||||
|
* A view which lists your model instances and simultaniously allows creation of instances
|
||||||
|
from that view.
|
||||||
|
|
||||||
|
* Another view which lets you view, update or delete your model instances individually.
|
||||||
|
|
||||||
``urls.py``::
|
``urls.py``::
|
||||||
|
|
||||||
from django.conf.urls.defaults import patterns, url
|
from django.conf.urls.defaults import patterns, url
|
||||||
|
@ -85,27 +92,6 @@ Using Django REST framework can be as simple as adding a few lines to your urlco
|
||||||
url(r'^(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=MyResource)),
|
url(r'^(?P<pk>[^/]+)/$', InstanceModelView.as_view(resource=MyResource)),
|
||||||
)
|
)
|
||||||
|
|
||||||
Django REST framework comes with two "getting started" examples.
|
|
||||||
|
|
||||||
#. :doc:`examples/views`
|
|
||||||
#. :doc:`examples/modelviews`
|
|
||||||
|
|
||||||
Examples
|
|
||||||
--------
|
|
||||||
|
|
||||||
There are a few real world web API examples included with Django REST framework.
|
|
||||||
|
|
||||||
#. :doc:`examples/objectstore` - Using :class:`views.View` classes for APIs that do not map to models.
|
|
||||||
#. :doc:`examples/pygments` - Using :class:`views.View` classes with forms for input validation.
|
|
||||||
#. :doc:`examples/blogpost` - Using :class:`views.ModelView` classes for APIs that map directly to models.
|
|
||||||
|
|
||||||
All the examples are freely available for testing in the sandbox:
|
|
||||||
|
|
||||||
http://rest.ep.io
|
|
||||||
|
|
||||||
(The :doc:`examples/sandbox` resource is also documented.)
|
|
||||||
|
|
||||||
|
|
||||||
How Tos, FAQs & Notes
|
How Tos, FAQs & Notes
|
||||||
---------------------
|
---------------------
|
||||||
|
|
||||||
|
@ -117,31 +103,15 @@ How Tos, FAQs & Notes
|
||||||
howto/alternativeframeworks
|
howto/alternativeframeworks
|
||||||
howto/mixin
|
howto/mixin
|
||||||
|
|
||||||
Library Reference
|
.. include:: library.rst
|
||||||
-----------------
|
|
||||||
|
|
||||||
|
.. include:: examples.rst
|
||||||
|
|
||||||
.. toctree::
|
.. toctree::
|
||||||
:maxdepth: 1
|
:hidden:
|
||||||
|
|
||||||
library/authentication
|
contents
|
||||||
library/compat
|
|
||||||
library/mixins
|
|
||||||
library/parsers
|
|
||||||
library/permissions
|
|
||||||
library/renderers
|
|
||||||
library/resource
|
|
||||||
library/response
|
|
||||||
library/serializer
|
|
||||||
library/status
|
|
||||||
library/views
|
|
||||||
|
|
||||||
Example Reference
|
|
||||||
-----------------
|
|
||||||
|
|
||||||
.. toctree::
|
|
||||||
:maxdepth: 2
|
|
||||||
|
|
||||||
examples.rst
|
|
||||||
|
|
||||||
Indices and tables
|
Indices and tables
|
||||||
------------------
|
------------------
|
||||||
|
|
8
docs/library.rst
Normal file
8
docs/library.rst
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
Library
|
||||||
|
=======
|
||||||
|
|
||||||
|
.. toctree::
|
||||||
|
:maxdepth: 1
|
||||||
|
:glob:
|
||||||
|
|
||||||
|
library/*
|
3
docs/templates/layout.html
vendored
3
docs/templates/layout.html
vendored
|
@ -23,5 +23,6 @@
|
||||||
})();
|
})();
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
{% endblock %}{% block footer %}
|
{% endblock %}
|
||||||
|
{% block footer %}
|
||||||
<div class="footer"> <p> Documentation version {{ version }} {% endblock %}</p></div>
|
<div class="footer"> <p> Documentation version {{ version }} {% endblock %}</p></div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user