Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

updated readme file

  • Loading branch information...
commit d76a0abe1493d303146b0a5d511b5835c10dd7fd 1 parent d7f439b
@fatiherikli fatiherikli authored
Showing with 90 additions and 2 deletions.
  1. +89 −1 README.md
  2. +1 −1  example/api/playgrounds.py
View
90 README.md
@@ -1 +1,89 @@
-coming soon.
+Django API Playground
+---------------------
+
+A django app that creates api explorer for RESTful APIs.
+
+Works with any RESTful API. For example, you can create api explorer for your tastypie based API with this app.
+
+![API Playground](http://s7.postimage.org/66ssdqy89/api_playground_1.png)
+
+![API Playground](http://s8.postimage.org/3lqgzpu8j/api_playground_2.png)
+
+
+Instructions
+------------
+
+Install from the pip:
+
+ pip install django-api-playground
+
+Or from the source:
+
+ git clone git://github.com/fatiherikli/django-api-playground.git
+ cd django-api-playground
+ python setup.py install
+
+Add to installed apps:
+
+ INSTALLED_APPS =(
+ # ...
+
+ 'apiplayground',
+ )
+
+Installation is completed. You can define the API schema now.
+
+Firs step, Create a url:
+
+ # urls.py
+
+ from api.playgrounds import ExampleAPIPlayground
+
+ urlpatterns = patterns('',
+ (r'api-explorer/', include(ExampleAPIPlayground().urls)),
+ )
+
+Second step, Define a subclass for your API:
+
+ # api/playgrounds.py
+
+ from apiplayground import APIPlayground
+
+ class ExampleAPIPlayground(APIPlayground):
+
+ schema = {
+ "title": "API Playground",
+ "base_url": "http://localhost/api/",
+ "resources": [
+ {
+ "name": "/feedbacks",
+ "description": "This resource allows you to manage feedbacks.",
+ "endpoints": [
+ {
+ "method": "GET",
+ "url": "/api/feedbacks/{feedback-id}",
+ "description": "Returns a specific feedback item"
+ },
+ {
+ "method": "POST",
+ "url": "/api/feedbacks/",
+ "description": "Creates new feedback item",
+ "parameters": [{
+ "name": "title",
+ "type": "string"
+ },
+ {
+ "name": "resource",
+ "type": "string"
+ },
+ {
+ "name": "description",
+ "type": "string"
+ }]
+ }
+ ]
+ },
+ ]
+ }
+
+That's all. More detailed documentation will be coming soon.
View
2  example/api/playgrounds.py
@@ -66,7 +66,7 @@ class ExampleAPIPlayground(APIPlayground):
{
"method": "DELETE",
"url": "/api/todos/{todo-id}",
- "description": "Delete specific to-do item"
+ "description": "Removes specific to-do item"
},
]
},
Please sign in to comment.
Something went wrong with that request. Please try again.