Re: Proposal: Track used headers and use that information to automatically populate Vary header.

2019-01-25 Thread Linus Lewandowski
it's always easier to add that another patch_vary_headers invocation than to add a new package, so the usage won't be high; but I'll probably do so, at least for my own usage. I'm already using it in one project, and I need it in others. On Fri, Jan 25, 2019 at 4:56 P

Proposal: Track used headers and use that information to automatically populate Vary header.

2019-01-25 Thread Linus Lewandowski
he Vary header based on 1), 3) deprecating patch_vary_headers function and vary_on_headers/vary_on_cookie decorators and recommending to use request.headers instead? Thanks, Linus PS. This is a follow-up to the https://code.djangoproject.com/ticket/28533 ticket. -- You received this message

Re: Make bool(AnonymousUser) evaluate to false

2017-06-01 Thread Linus Lewandowski
maybe it's a good idea to report a warning in the __bool__ method? In most cases, bool(AnonymousUser) is a programming error, and not a valid code, so this might be helpful. We could make it a warning forever, or use RemovedInDjango30Warning, and then switch to return False OR an exception in 3

Make bool(AnonymousUser) evaluate to false

2017-05-31 Thread linus
I suggest adding __bool__() method returning False to the AnonymousUser class. This way it'll be possible to check if the user is authenticated by simply writing "if request.user:" It's a frequent source of bugs (at least for me, but probably I'm not alone) that right now this code returns Tru

Re: Integrate dj-database-url into Django

2017-05-28 Thread linus
ively, or at least with a single function call like this one. Regards, Linus On Sunday, May 28, 2017 at 12:09:57 AM UTC+2, Tim Allen wrote: > > I've recently been introduced to `django-environ`, a similar library that > has additional features to DB connect URLs that we may want to