Saturday, October 25, 2014

Re: New way to use URL dispatchers?

ah! thank you, because this is the 'cleanest' way, espetially for a beginner.
thank you :)

Le samedi 25 octobre 2014 21:04:49 UTC+1, Carl Meyer a écrit :

On Oct 24, 2014, at 8:37 PM, Russell Keith-Magee <rus...@keith-magee.com> wrote:

When it is released, Django 1.8 will include support for the new preferred format for URLpatterns. Django 1.7 doesn't support this new format, and the documentation for version 1.7:


doesn't mention the new format. 

Small clarification: the "new" way (urlpatterns just a list of urls) actually works just fine in 1.7, 1.6, and earlier versions of Django too (as long as you use the `url(…)` function to define each url, and import your views rather than referencing them as strings). So you can switch to it right now, regardless of what Django version you are using.

The 1.7 docs still use the `patterns(…)` function (which is deprecated starting in 1.8) simply in order to maintain compatibility with the output of 1.7's startproject command.

Carl

--
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 http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/2a65c7b9-ded6-410c-b357-0023a6618d79%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment