regluit/api/urls.py

33 lines
1.4 KiB
Python
Raw Normal View History

2011-09-12 20:02:06 +00:00
from tastypie.api import Api
2013-06-03 16:31:39 +00:00
from django.conf.urls.defaults import *
from django.views.generic.base import TemplateView
2011-09-12 20:02:06 +00:00
from regluit.api import resources
2013-06-03 16:31:39 +00:00
from regluit.api.views import ApiHelpView
from regluit.api.views import OPDSNavigationView, OPDSAcquisitionView
from regluit.api.views import OnixView
v1_api = Api(api_name='v1')
v1_api.register(resources.WorkResource())
v1_api.register(resources.IdentifierResource())
v1_api.register(resources.EditionResource())
v1_api.register(resources.CampaignResource())
v1_api.register(resources.AuthorResource())
v1_api.register(resources.SubjectResource())
2015-12-19 01:21:28 +00:00
v1_api.register(resources.FreeResource())
2011-09-12 20:02:06 +00:00
urlpatterns = patterns('',
url(r'^help$', ApiHelpView.as_view(), name="api_help"),
url(r'^widget/(?P<isbn>\w+)/$','regluit.api.views.widget',name="widget"),
url(r"^opds/$", OPDSNavigationView.as_view(template_name="opds.xml"), name="opds"),
url(r"^opds/(?P<facet>.*)/$", OPDSAcquisitionView.as_view(), name="opds_acqusition"),
url(r"^onix/(?P<facet>.*)/$", OnixView.as_view(), name="onix"),
2015-08-28 20:20:46 +00:00
url(r"^onix/$", OnixView.as_view(), name="onix_all"),
url(r'^id/work/(?P<work_id>\w+)/$', 'regluit.api.views.negotiate_content', name="work_identifier"),
2015-07-30 04:34:05 +00:00
url(r'^loader/yaml$','regluit.api.views.load_yaml', name="load_yaml"),
2016-02-18 19:37:35 +00:00
url(r'^travisci/webhook$','regluit.api.views.travisci_webhook', name="travisci_webhook"),
(r'^', include(v1_api.urls)),
2011-09-12 20:02:06 +00:00
)