aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/check_sphinx.py7
-rw-r--r--docs/contents.rst9
-rw-r--r--docs/examples.rst26
-rw-r--r--docs/index.rst52
-rw-r--r--docs/library.rst8
-rw-r--r--docs/templates/layout.html3
-rw-r--r--tox.ini79
7 files changed, 128 insertions, 56 deletions
diff --git a/docs/check_sphinx.py b/docs/check_sphinx.py
index 74874eed..feb04abd 100644
--- a/docs/check_sphinx.py
+++ b/docs/check_sphinx.py
@@ -1,13 +1,6 @@
import pytest
import subprocess
-def test_linkcheck(tmpdir):
- doctrees = tmpdir.join("doctrees")
- htmldir = tmpdir.join("html")
- subprocess.check_call(
- ["sphinx-build", "-q", "-blinkcheck",
- "-d", str(doctrees), ".", str(htmldir)])
-
def test_build_docs(tmpdir):
doctrees = tmpdir.join("doctrees")
htmldir = "html" #we want to keep the docs
diff --git a/docs/contents.rst b/docs/contents.rst
new file mode 100644
index 00000000..4dbe5baa
--- /dev/null
+++ b/docs/contents.rst
@@ -0,0 +1,9 @@
+Documentation
+=============
+
+.. toctree::
+ :maxdepth: 2
+
+ library
+ examples
+
diff --git a/docs/examples.rst b/docs/examples.rst
index 911ebdf3..64088345 100644
--- a/docs/examples.rst
+++ b/docs/examples.rst
@@ -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::
:maxdepth: 1
+ :glob:
- examples/views
- examples/modelviews
- examples/objectstore
- examples/pygments
- examples/blogpost
- examples/sandbox
+ examples/*
diff --git a/docs/index.rst b/docs/index.rst
index be2e9cab..bec9e67f 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -70,6 +70,13 @@ Getting Started
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``::
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)),
)
-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
---------------------
@@ -117,31 +103,15 @@ How Tos, FAQs & Notes
howto/alternativeframeworks
howto/mixin
-Library Reference
------------------
+.. include:: library.rst
-.. toctree::
- :maxdepth: 1
- library/authentication
- library/compat
- library/mixins
- library/parsers
- library/permissions
- library/renderers
- library/resource
- library/response
- library/serializer
- library/status
- library/views
-
-Example Reference
------------------
+.. include:: examples.rst
.. toctree::
- :maxdepth: 2
+ :hidden:
- examples.rst
+ contents
Indices and tables
------------------
diff --git a/docs/library.rst b/docs/library.rst
new file mode 100644
index 00000000..b0309da0
--- /dev/null
+++ b/docs/library.rst
@@ -0,0 +1,8 @@
+Library
+=======
+
+.. toctree::
+ :maxdepth: 1
+ :glob:
+
+ library/*
diff --git a/docs/templates/layout.html b/docs/templates/layout.html
index 70532554..a59645f2 100644
--- a/docs/templates/layout.html
+++ b/docs/templates/layout.html
@@ -23,5 +23,6 @@
})();
</script>
-{% endblock %}{% block footer %}
+{% endblock %}
+{% block footer %}
<div class="footer"> <p> Documentation version {{ version }} {% endblock %}</p></div>
diff --git a/tox.ini b/tox.ini
index 1375568c..015b5d2e 100644
--- a/tox.ini
+++ b/tox.ini
@@ -9,13 +9,18 @@ envlist=
py25-django13,
py26-django13,
py27-django13,
-
+ py25-django14a1,
+ py26-django14a1,
+ py27-django14a1,
py25-django12e,
py26-django12e,
py27-django12e,
py25-django13e,
py26-django13e,
py27-django13e
+ py25-django14a1e,
+ py26-django14a1e,
+ py27-django14a1e
########################################### CORE TESTS ############################################
@@ -83,6 +88,36 @@ deps=
# Optional packages:
markdown
+[testenv:py25-django14a1]
+basepython=python2.5
+deps=
+ http://www.djangoproject.com/download/1.4-alpha-1/tarball/
+ coverage==3.4
+ unittest-xml-reporting==1.2
+ Pyyaml==3.10
+ # Optional packages:
+ markdown
+
+[testenv:py26-django14a1]
+basepython=python2.6
+deps=
+ http://www.djangoproject.com/download/1.4-alpha-1/tarball/
+ coverage==3.4
+ unittest-xml-reporting==1.2
+ Pyyaml==3.10
+ # Optional packages:
+ markdown
+
+[testenv:py27-django14a1]
+basepython=python2.7
+deps=
+ http://www.djangoproject.com/download/1.4-alpha-1/tarball/
+ coverage==3.4
+ unittest-xml-reporting==1.2
+ Pyyaml==3.10
+ # Optional packages:
+ markdown
+
####################################### EXAMPLES ################################################
[testenv:py25-django12e]
@@ -169,6 +204,48 @@ deps=
unittest-xml-reporting==1.2
Pyyaml==3.10
+[testenv:py25-django14a1e]
+basepython=python2.5
+commands=
+ python examples/runtests.py
+deps=
+ http://www.djangoproject.com/download/1.4-alpha-1/tarball/
+ coverage==3.4
+ wsgiref==0.1.2
+ Pygments==1.4
+ httplib2==0.6.0
+ Markdown==2.0.3
+ unittest-xml-reporting==1.2
+ Pyyaml==3.10
+
+[testenv:py26-django14a1e]
+basepython=python2.6
+commands=
+ python examples/runtests.py
+deps=
+ http://www.djangoproject.com/download/1.4-alpha-1/tarball/
+ coverage==3.4
+ wsgiref==0.1.2
+ Pygments==1.4
+ httplib2==0.6.0
+ Markdown==2.0.3
+ unittest-xml-reporting==1.2
+ Pyyaml==3.10
+
+[testenv:py27-django14a1e]
+basepython=python2.7
+commands=
+ python examples/runtests.py
+deps=
+ http://www.djangoproject.com/download/1.4-alpha-1/tarball/
+ coverage==3.4
+ wsgiref==0.1.2
+ Pygments==1.4
+ httplib2==0.6.0
+ Markdown==2.0.3
+ unittest-xml-reporting==1.2
+ Pyyaml==3.10
+
##########################################DOCS#################################################
[testenv:docs]