mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-26 19:43:59 +03:00
9 lines
414 B
Python
9 lines
414 B
Python
from django.conf.urls.defaults import patterns, url
|
|
from djangorestframework.views import ListOrCreateModelView, InstanceModelView
|
|
from modelresourceexample.resources import MyModelResource
|
|
|
|
urlpatterns = patterns('',
|
|
url(r'^$', ListOrCreateModelView.as_view(resource=MyModelResource), name='model-resource-root'),
|
|
url(r'^(?P<pk>[0-9]+)/$', InstanceModelView.as_view(resource=MyModelResource)),
|
|
)
|