Re: Adding an some warnings, checks, or exceptions for urls

2016-04-25 Thread Robert Roskam
I totally agree. There are circumstances when you'll omit a caret or a 
dollar sign, but as far as I can think of, it would seem to only be related 
to an include, so couldn't there be some kind of inspection done on whether 
there's an include an raise some message to basically say "yeah, I'm 
sure."? I think there could be.

One thing I hadn't thought about, though, is that core django maybe not be 
the right place, maybe django-lint or something like that.


On Monday, April 25, 2016 at 12:48:00 PM UTC-4, Tom Evans wrote:
>
> On Mon, Apr 25, 2016 at 1:00 PM, Robert Roskam  > wrote: 
> > I realize this is a really, really obvious and easily fixed newbie 
> error. 
> > But here it is: 
> > 
> > urlpatterns = [ 
> > url(r'^sitemap/', 
> > TemplateView.as_view(template_name='brochure/sitemap.html'), 
> > name="sitemap"), 
> > # More urls 
> > ] 
> > 
> > Sitemap should end with dollar sign. 
>
> The problem is that the url should *usually* end with a dollar sign. 
> There are valid use cases for a url not starting with a caret or 
> ending with a dollar. 
>
> Cheers 
>
> Tom 
>

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/dc5a5373-540d-4c67-b4f8-b66ed745169a%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: Adding an some warnings, checks, or exceptions for urls

2016-04-25 Thread 'Tom Evans' via Django developers (Contributions to Django itself)
On Mon, Apr 25, 2016 at 1:00 PM, Robert Roskam  wrote:
> I realize this is a really, really obvious and easily fixed newbie error.
> But here it is:
>
> urlpatterns = [
> url(r'^sitemap/',
> TemplateView.as_view(template_name='brochure/sitemap.html'),
> name="sitemap"),
> # More urls
> ]
>
> Sitemap should end with dollar sign.

The problem is that the url should *usually* end with a dollar sign.
There are valid use cases for a url not starting with a caret or
ending with a dollar.

Cheers

Tom

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/CAFHbX1JcWdZbdLs3HzD-z671tdDbXO2TU%3DQLf_UvjjRbySGYEw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.


Adding an some warnings, checks, or exceptions for urls

2016-04-25 Thread Robert Roskam
I realize this is a really, really obvious and easily fixed newbie error. 
But here it is:

urlpatterns = [
url(r'^sitemap/', 
TemplateView.as_view(template_name='brochure/sitemap.html'), 
name="sitemap"),
# More urls
]

Sitemap should end with dollar sign. The problem isn't bad when it 
immediately happens and you can slap yourself over the face and fix it. The 
problem is when you have a massive stack of these url patterns and you 
don't have a problem until you max a change by reordering.

So I think something should exist to make this easier to discover. Maybe a 
check or a warning. An exception seems rather harsh.

-- 
You received this message because you are subscribed to the Google Groups 
"Django developers  (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-developers+unsubscr...@googlegroups.com.
To post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/a538d0ab-76c7-4b5a-9030-9b6892276382%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.