aboutsummaryrefslogtreecommitdiffstats
path: root/docs
diff options
context:
space:
mode:
Diffstat (limited to 'docs')
-rw-r--r--docs/conf.py2
-rw-r--r--docs/index.rst28
-rw-r--r--docs/requirements.txt8
3 files changed, 17 insertions, 21 deletions
diff --git a/docs/conf.py b/docs/conf.py
index 71cacb3d..3689a636 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -14,7 +14,7 @@
import sys, os
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
-sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'flywheel'))
+sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'djangorestframework'))
sys.path.insert(0, os.path.join(os.path.dirname(os.path.dirname(__file__)), 'examples'))
import settings
from django.core.management import setup_environ
diff --git a/docs/index.rst b/docs/index.rst
index 7a871a5c..7da3f017 100644
--- a/docs/index.rst
+++ b/docs/index.rst
@@ -26,10 +26,10 @@ Requirements
Installation & Setup
--------------------
-The django-rest-framework project is hosted as a `mercurial repository on bitbucket <https://bitbucket.org/tomchristie/flywheel>`_.
+The django-rest-framework project is hosted as a `mercurial repository on bitbucket <https://bitbucket.org/tomchristie/django-rest-framework>`_.
To get a local copy of the repository use mercurial::
- hg clone https://tomchristie@bitbucket.org/tomchristie/flywheel
+ hg clone https://tomchristie@bitbucket.org/tomchristie/django-rest-framework
To add django-rest-framework to a django project:
@@ -43,27 +43,15 @@ Getting Started
Often you'll want parts of your API to directly map to existing Models.
At it's simplest this looks something like this...
-``views.py``::
+``urls.py``
- from djangorestframework.modelresource import ModelResource, ModelRootResource
- from models import MyModel
+.. include:: ../examples/simpleexample/urls.py
+ :literal:
- class MyModelRootResource(ModelRootResource):
- """A create/list resource for MyModel."""
- allowed_methods = ('GET', 'POST')
- model = MyModel
+``views.py``
- class MyModelResource(ModelResource):
- """A read/update/delete resource for MyModel."""
- allowed_methods = ('GET', 'PUT', 'DELETE')
- model = MyModel
-
-``urls.py``::
-
- urlpatterns += patterns('myapp.views',
- url(r'^mymodel/$', 'MyModelRootResource'),
- url(r'^mymodel/([^/]+)/$', 'MyModelResource'),
- )
+.. include:: ../examples/simpleexample/views.py
+ :literal:
Examples
diff --git a/docs/requirements.txt b/docs/requirements.txt
new file mode 100644
index 00000000..77cdf485
--- /dev/null
+++ b/docs/requirements.txt
@@ -0,0 +1,8 @@
+# Documentation requires Django & Sphinx, and their dependencies...
+
+Django==1.2.4
+Jinja2==2.5.5
+Pygments==1.4
+Sphinx==1.0.7
+docutils==0.7
+wsgiref==0.1.2