aboutsummaryrefslogtreecommitdiffstats
path: root/examples/urls.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/urls.py')
-rw-r--r--examples/urls.py40
1 files changed, 11 insertions, 29 deletions
diff --git a/examples/urls.py b/examples/urls.py
index 41b80d58..03894e4e 100644
--- a/examples/urls.py
+++ b/examples/urls.py
@@ -1,37 +1,19 @@
-from django.conf.urls.defaults import patterns, include
-#from django.contrib import admin
-from djangorestframework.resource import Resource
+from django.conf.urls.defaults import patterns, include, url
+from sandbox.views import Sandbox
-#admin.autodiscover()
+urlpatterns = patterns('djangorestframework.views',
+ (r'robots.txt', 'deny_robots'),
+ (r'favicon.ico', 'favicon'),
-class RootResource(Resource):
- """This is the sandbox for the examples provided with django-rest-framework.
+ (r'^$', Sandbox.as_view()),
- These examples are here to help you get a better idea of the some of the
- features of django-rest-framework API, such as automatic form and model validation,
- support for multiple input and output media types, etc...
-
- Please feel free to browse, create, edit and delete the resources here, either
- in the browser, from the command line, or programmatically."""
- allowed_methods = anon_allowed_methods = ('GET',)
-
- def get(self, request, auth):
- return {'Simple Resource example': self.reverse('resourceexample.views.ExampleResource'),
- 'Simple ModelResource example': self.reverse('modelresourceexample.views.MyModelRootResource'),
- 'Object store API (Resource)': self.reverse('objectstore.views.ObjectStoreRoot'),
- 'A pygments pastebin API (Resource + forms)': self.reverse('pygments_api.views.PygmentsRoot'),
- 'Blog posts API (ModelResource)': self.reverse('blogpost.views.BlogPostRoot'),}
-
-
-urlpatterns = patterns('',
- (r'^$', RootResource),
- (r'^model-resource-example/', include('modelresourceexample.urls')),
(r'^resource-example/', include('resourceexample.urls')),
+ (r'^model-resource-example/', include('modelresourceexample.urls')),
+ (r'^mixin/', include('mixin.urls')),
(r'^object-store/', include('objectstore.urls')),
(r'^pygments/', include('pygments_api.urls')),
(r'^blog-post/', include('blogpost.urls')),
- (r'^accounts/login/$', 'django.contrib.auth.views.login'),
- (r'^accounts/logout/$', 'django.contrib.auth.views.logout'),
- #(r'^admin/doc/', include('django.contrib.admindocs.urls')),
- #(r'^admin/', include(admin.site.urls)),
+
+ (r'^accounts/login/$', 'api_login'),
+ (r'^accounts/logout/$', 'api_logout'),
)