diff options
| author | tom christie tom@tomchristie.com | 2011-02-19 10:26:27 +0000 |
|---|---|---|
| committer | tom christie tom@tomchristie.com | 2011-02-19 10:26:27 +0000 |
| commit | 805aa03ec1871f6a766d9052b348ddce9e9843c3 (patch) | |
| tree | 8ab5b6a7396236aa45bbc61e8404cc77fc75a9c5 /examples/urls.py | |
| parent | b749b950a1b4bede76b7e3900a6385779904902d (diff) | |
| download | django-rest-framework-805aa03ec1871f6a766d9052b348ddce9e9843c3.tar.bz2 | |
Yowzers. Final big bunch of refactoring for 0.1 release. Now support Django 1.3's views, admin style api is all polished off, loads of tests, new test project for running the test. All sorts of goodness. Getting ready to push this out now.
Diffstat (limited to 'examples/urls.py')
| -rw-r--r-- | examples/urls.py | 40 |
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'), ) |
