added link to PR, some cleaning
[wolnelektury.git] / apps / api / urls.py
1 # -*- coding: utf-8 -*-
2 from django.conf.urls.defaults import *
3 from piston.resource import Resource
4 from piston.authentication import OAuthAuthentication
5
6 from api.handlers import BooksHandler
7
8
9 auth = OAuthAuthentication(realm="Wolne Lektury")
10 book_resource = Resource(handler=BooksHandler, authentication=auth)
11
12
13 urlpatterns = patterns('',  
14     url(r'^books/(?P<slug>[^/]+)\.(?P<emitter_format>xml|json|yaml)$', book_resource),
15     url(r'^books\.(?P<emitter_format>xml|json|yaml)$', book_resource),
16
17 ) + patterns(
18     'piston.authentication',
19     url(r'^oauth/request_token/$','oauth_request_token'),
20     url(r'^oauth/authorize/$','oauth_user_auth'),
21     url(r'^oauth/access_token/$','oauth_access_token'),
22 )