I'm not sure I understand the question, but here's my input:
- You can use either url() or path() and achieve the same thing
- However, I assume that the older url() is being deprecated, so you should use the newer path() if your version supports it
- My cheat sheet is often the examples in the very good official tutorial.
- I generally just go to the latest and then twiddle the version in the URL to compare:
- CURRENT - with new path(): https://docs.djangoproject.com/en/2.0/topics/http/urls/
- 1.11 - with older url(): https://docs.djangoproject.com/en/1.11/topics/http/urls/ (note I just changed "2.0" to "1.11"...)
- https://www.google.com/search?q=django+2+cheat+sheet
- Better yet, make the cheattsheet of your dreams, put it on the web, and maybe someday you'll be a famous Django guru!!!
On 04/30/2018 10:53 PM, Kayode Oladipo wrote:
Hi there again! Beginner here using Django 2.0.
I'm following a tutorial (coupled with the official doc for compatibility) and I discovered that <2.0 versions use RegEx with the url but 2.0> uses the simplified path() function.
My question is how do I find the right corresponding path() function to a url (),
A cheat sheet would be wonderful.Cheers!
--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CA%2BARzD8HO26aTwpdYe1km9_%3DykDgBF_y%3DRfkNhrpFvHmSsea6w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
No comments:
Post a Comment