diff --git a/readthedocs/api/base.py b/readthedocs/api/base.py index 2fd3ee70068..0f1dde6e29c 100644 --- a/readthedocs/api/base.py +++ b/readthedocs/api/base.py @@ -186,6 +186,7 @@ class Meta: def override_urls(self): return [ + url(r"^(?P%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"), url(r"^(?P%s)/(?P[a-z-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name="api_dispatch_detail"), ] @@ -229,6 +230,7 @@ def post_list(self, request, **kwargs): def override_urls(self): return [ + url(r"^(?P%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"), url(r"^(?P%s)/search%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('get_search'), name="api_get_search"), url(r"^(?P%s)/(?P[a-z-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_detail'), name="api_dispatch_detail"), ] @@ -253,6 +255,7 @@ class Meta: def override_urls(self): return [ + url(r"^(?P%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"), url(r"^(?P%s)/(?P[a-z-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_list'), name="build_list_detail"), ] @@ -313,6 +316,7 @@ def build_version(self, request, **kwargs): def override_urls(self): return [ + url(r"^(?P%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"), url(r"^(?P%s)/(?P[a-z-_]+)/highest/(?P.+)/$" % self._meta.resource_name, self.wrap_view('version_compare'), name="version_compare"), url(r"^(?P%s)/(?P[a-z-_]+)/highest/$" % self._meta.resource_name, self.wrap_view('version_compare'), name="version_compare"), url(r"^(?P%s)/(?P[a-z-_]+[a-z0-9-_]+)/$" % self._meta.resource_name, self.wrap_view('dispatch_list'), name="api_version_list"), @@ -334,6 +338,7 @@ class Meta: def override_urls(self): return [ + url(r"^(?P%s)/schema/$" % self._meta.resource_name, self.wrap_view('get_schema'), name="api_get_schema"), url(r"^(?P%s)/search%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('get_search'), name="api_get_search"), url(r"^(?P%s)/anchor%s$" % (self._meta.resource_name, trailing_slash()), self.wrap_view('get_anchor'), name="api_get_anchor"), ] diff --git a/readthedocs/templates/admin.html b/readthedocs/templates/admin.html new file mode 100644 index 00000000000..7487a941b2b --- /dev/null +++ b/readthedocs/templates/admin.html @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/readthedocs/urls.py b/readthedocs/urls.py index 2d542672c4a..196f2fa0925 100644 --- a/readthedocs/urls.py +++ b/readthedocs/urls.py @@ -1,6 +1,7 @@ from django.conf.urls.defaults import url, patterns, include from django.contrib import admin from django.conf import settings +from django.views.generic.simple import direct_to_template from tastypie.api import Api @@ -23,6 +24,8 @@ urlpatterns = patterns('', url(r'^$', 'core.views.homepage'), + url(r'^_admin/', direct_to_template, {'template': 'admin.html'}), + url(r'^docs/(?P[-\w]+)/(?Pen)/(?P[-._\w]+?)/(?P.*)$', 'core.views.serve_docs', name='docs_detail'