Search This Website

Wednesday, 30 September 2009

Web Services in Python + Django

Using the Django-Piston: lets you easily create programmatic RESTful APIs for your Django website.Getting Started:

Step 1:
place your API code in a separate folder, e.g. 'api'.
Your application layout could look like this:

urls.py
settings.py
myapp/
   __init__.py
   views.py
   models.py
api/
   __init__.py
   urls.py
   handlers.py
Step 2:
place your API code in a separate folder, e.g. 'api'.
Your application layout could look like this:

urlpatterns = patterns('',
   # all my other url mappings
   (r'^api/', include('mysite.api.urls')),
)

No comments:

Post a Comment