Skip to content

Conversation

@basilbegonia
Copy link

@basilbegonia basilbegonia commented Mar 29, 2019

Description

The docs always use url() in examples. However, re_path is recommended by the django docs and url() is likely to be deprecated

@basilbegonia basilbegonia changed the title update docs to use re_path() instead of url(r... update docs to use re_path() instead of url() Mar 29, 2019
Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

just curious, why not path() instead of re_path?

@xordoquy
Copy link
Contributor

Now that we've dropped Django < 2.0 (did we ?) it should be fine.
re_path is more straightforward but I guess path would be more beginner friendly.

@auvipy
Copy link
Collaborator

auvipy commented Mar 29, 2019

That's what I am for Path() :)

@carltongibson
Copy link
Collaborator

We're support Django 1.11 until it's EOL (so another 9 months yet...)

(We're going to drop Python 2 for DRF 3.10. Yes, @auvipy, I'll get to your PR 🙂)

@carltongibson
Copy link
Collaborator

Personally, I'd be happy to update all these examples to path() now.

Conjecture: No-one is starting a project on 1.11 (and doesn't already know what they're about) at this point.

@auvipy
Copy link
Collaborator

auvipy commented Mar 29, 2019

Should I resume the work to finish the remaining python2 parts?

@basilbegonia
Copy link
Author

Good point on path(). I added a commit to change the examples from re_path() to path(). Although some re_path() examples had regex in them so I have not converted them yet. Do you suggest we also convert the other examples to use the angle brackets (e.g. <int:x>) so we can use path() instead?

Copy link
Collaborator

@auvipy auvipy left a comment

Choose a reason for hiding this comment

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

awesome work! angle bracket and type are not must be required. So IMHO without that, it should be fine. though the core team could share better insight regarding that.

@carltongibson
Copy link
Collaborator

carltongibson commented Mar 30, 2019

I'm happy for you to leave some re_path() examples too. (That's not going anywhere...)

@basilbegonia basilbegonia changed the title update docs to use re_path() instead of url() update docs to use path / re_path() instead of url() Apr 24, 2019
@basilbegonia basilbegonia changed the title update docs to use path / re_path() instead of url() update docs to use path() / re_path() instead of url() Apr 24, 2019
@rpkilby
Copy link
Contributor

rpkilby commented May 9, 2019

Aside: from the upcoming release notes:

Following the release of Django 3.0, we suggest that third-party app authors drop support for all versions of Django prior to 2.2.

Given that Django 3.0 will be released in December, we can revisit this ticket then.

@lovelydinosaur
Copy link
Contributor

This would be a really nice addition, yup. There's a few conflicts that need resolving.

(And yes, we still support Django 1.11, but that's no good reason for us to not use the nicer syntax in the docs.)

@smithdc1
Copy link
Contributor

smithdc1 commented Sep 8, 2020

I think this PR can be closed as well following #7512

@adamchainz
Copy link
Contributor

#7512 has indeed fixed these. Thanks for the initial work @basilbegonia

@adamchainz adamchainz closed this Oct 10, 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.

8 participants