mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-04 20:40:14 +03:00
Add the snippets.url to the tutorial mast urls.py
Not sure what versions of Django this may be required for - I needed it in my old 1.5 install
This commit is contained in:
parent
8c8d355e76
commit
9d8875d6f5
|
@ -303,6 +303,14 @@ Finally we need to wire these views up. Create the `snippets/urls.py` file:
|
||||||
url(r'^snippets/(?P<pk>[0-9]+)/$', 'snippet_detail'),
|
url(r'^snippets/(?P<pk>[0-9]+)/$', 'snippet_detail'),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
Then edit tutorial/urls.py and add:
|
||||||
|
|
||||||
|
import snippets.urls
|
||||||
|
|
||||||
|
urlpatterns = patterns('',
|
||||||
|
url(r'', include('snippets.urls')),
|
||||||
|
)
|
||||||
|
|
||||||
It's worth noting that there are a couple of edge cases we're not dealing with properly at the moment. If we send malformed `json`, or if a request is made with a method that the view doesn't handle, then we'll end up with a 500 "server error" response. Still, this'll do for now.
|
It's worth noting that there are a couple of edge cases we're not dealing with properly at the moment. If we send malformed `json`, or if a request is made with a method that the view doesn't handle, then we'll end up with a 500 "server error" response. Still, this'll do for now.
|
||||||
|
|
||||||
## Testing our first attempt at a Web API
|
## Testing our first attempt at a Web API
|
||||||
|
|
Loading…
Reference in New Issue
Block a user