mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-22 17:47:04 +03:00
updated tutorial for django 1.9
This commit is contained in:
parent
450c76472b
commit
35036aee15
|
@ -45,7 +45,7 @@ We'll need to add our new `snippets` app and the `rest_framework` app to `INSTAL
|
||||||
INSTALLED_APPS = (
|
INSTALLED_APPS = (
|
||||||
...
|
...
|
||||||
'rest_framework',
|
'rest_framework',
|
||||||
'snippets',
|
'snippets.apps.SnippetsConfig',
|
||||||
)
|
)
|
||||||
|
|
||||||
Okay, we're ready to roll.
|
Okay, we're ready to roll.
|
||||||
|
@ -293,11 +293,11 @@ Finally we need to wire these views up. Create the `snippets/urls.py` file:
|
||||||
url(r'^snippets/$', views.snippet_list),
|
url(r'^snippets/$', views.snippet_list),
|
||||||
url(r'^snippets/(?P<pk>[0-9]+)/$', views.snippet_detail),
|
url(r'^snippets/(?P<pk>[0-9]+)/$', views.snippet_detail),
|
||||||
]
|
]
|
||||||
|
|
||||||
We also need to wire up the root urlconf, in the `tutorial/urls.py` file, to include our snippet app's URLs.
|
We also need to wire up the root urlconf, in the `tutorial/urls.py` file, to include our snippet app's URLs.
|
||||||
|
|
||||||
from django.conf.urls import url, include
|
from django.conf.urls import url, include
|
||||||
|
|
||||||
urlpatterns = [
|
urlpatterns = [
|
||||||
url(r'^', include('snippets.urls')),
|
url(r'^', include('snippets.urls')),
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user