diff --git a/AUTHORS b/AUTHORS index a7efe523..6a90ff25 100644 --- a/AUTHORS +++ b/AUTHORS @@ -1,5 +1,6 @@ Adam Wróbel Adam Ziolkowski +Alan Crosswell Christian Zosel Greg Aker Jamie Bliss diff --git a/docs/getting-started.md b/docs/getting-started.md index 4afcf2df..4b564418 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -70,13 +70,18 @@ From Source git clone https://github.com/django-json-api/django-rest-framework-json-api.git cd django-rest-framework-json-api - pip install -e . + python -m venv env + source env/bin/activate pip install -r example/requirements.txt - django-admin.py runserver + pip install -e . + django-admin.py startproject example . + python manage.py migrate + python manage.py runserver Browse to http://localhost:8000 ## Running Tests - python runtests.py + pip install tox + tox diff --git a/example/requirements.txt b/example/requirements.txt index a9660ae7..0fa77009 100644 --- a/example/requirements.txt +++ b/example/requirements.txt @@ -1,2 +1,13 @@ # Requirements specifically for the example app packaging +Django>=1.11 +django-debug-toolbar +django-polymorphic>=2.0 +djangorestframework +inflection +pluggy +py +pyparsing +pytz +six +sqlparse diff --git a/example/settings/dev.py b/example/settings/dev.py index d8b45738..61dfa443 100644 --- a/example/settings/dev.py +++ b/example/settings/dev.py @@ -59,7 +59,7 @@ PASSWORD_HASHERS = ('django.contrib.auth.hashers.UnsaltedMD5PasswordHasher', ) -MIDDLEWARE_CLASSES = ( +MIDDLEWARE = ( 'debug_toolbar.middleware.DebugToolbarMiddleware', ) diff --git a/example/urls.py b/example/urls.py index d6b58f3d..688ce70e 100644 --- a/example/urls.py +++ b/example/urls.py @@ -3,11 +3,16 @@ from rest_framework import routers from example.views import ( + AuthorRelationshipView, AuthorViewSet, + BlogRelationshipView, BlogViewSet, + CommentRelationshipView, CommentViewSet, CompanyViewset, + EntryRelationshipView, EntryViewSet, + NonPaginatedEntryViewSet, ProjectViewset ) @@ -15,6 +20,7 @@ router.register(r'blogs', BlogViewSet) router.register(r'entries', EntryViewSet) +router.register(r'nopage-entries', NonPaginatedEntryViewSet, 'nopage-entry') router.register(r'authors', AuthorViewSet) router.register(r'comments', CommentViewSet) router.register(r'companies', CompanyViewset) @@ -22,6 +28,22 @@ urlpatterns = [ url(r'^', include(router.urls)), + url(r'^entries/(?P[^/.]+)/suggested/', + EntryViewSet.as_view({'get': 'list'}), + name='entry-suggested' + ), + url(r'^entries/(?P[^/.]+)/relationships/(?P\w+)', + EntryRelationshipView.as_view(), + name='entry-relationships'), + url(r'^blogs/(?P[^/.]+)/relationships/(?P\w+)', + BlogRelationshipView.as_view(), + name='blog-relationships'), + url(r'^comments/(?P[^/.]+)/relationships/(?P\w+)', + CommentRelationshipView.as_view(), + name='comment-relationships'), + url(r'^authors/(?P[^/.]+)/relationships/(?P\w+)', + AuthorRelationshipView.as_view(), + name='author-relationships'), ]