Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tutorial to Django 2.0 routing syntax #5964

Merged
merged 4 commits into from
May 8, 2018
Merged

Update tutorial to Django 2.0 routing syntax #5964

merged 4 commits into from
May 8, 2018

Conversation

chrisshyi
Copy link
Contributor

@chrisshyi chrisshyi commented May 2, 2018

Updated part 1 of the DRF tutorial to use django.urls.path instead of
django.conf.urls.url

Description

refs #5963 , updated tutorial part 1 to use Django 2.0 routing syntax.

Updated part 1 of the DRF tutorial to use django.urls.path instead of
django.conf.urls.url
@encode encode deleted a comment from codecov-io May 3, 2018
@tomchristie
Copy link
Member

Looking good, thanks!

We'll need this pull request to include all the pages in the tutorial, so that we can update them all at once.

(Doesn't matter from our side if you choose to make each of those each as separate commits on this pull request, or add them all at once. We'll squash them into a single commit when we merge this.)

@@ -275,20 +275,22 @@ We'll also need a view which corresponds to an individual snippet, and can be us

Finally we need to wire these views up. Create the `snippets/urls.py` file:

from django.conf.urls import url
from django.urls import path
# note that the path function was added in Django 2.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd suggest we drop these two lines of comment.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do, I'll try to get through the rest of the tutorial pages in the next two days and update them to the new routing syntax as needed.

@chrisshyi chrisshyi changed the title Update tutorial part 1 to Django 2.0 routing syntax (#5963) Update tutorial to Django 2.0 routing syntax (#5963) May 5, 2018
@chrisshyi
Copy link
Contributor Author

chrisshyi commented May 5, 2018

Finished updating all tutorial pages to Django 2.0 routing syntax

@tomchristie
Copy link
Member

Yas! 😄

@tomchristie tomchristie merged commit fc21432 into encode:master May 8, 2018
@tomchristie tomchristie changed the title Update tutorial to Django 2.0 routing syntax (#5963) Update tutorial to Django 2.0 routing syntax May 8, 2018
@stooj
Copy link

stooj commented Jun 21, 2018

Hi @chrisshyi - I found one last url that was missed: https://github.com/encode/django-rest-framework/blob/master/docs/tutorial/6-viewsets-and-routers.md

It's in the "Using Routers" section:

# The API URLs are now determined automatically by the router.
urlpatterns = [
    url(r'^', include(router.urls))
]

@chrisshyi
Copy link
Contributor Author

chrisshyi commented Jun 21, 2018

Thanks @stooj - I've updated the file just now and created a pull request.

pchiquet pushed a commit to pchiquet/django-rest-framework that referenced this pull request Nov 17, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants