Maniac wrote:
> You could subclass django.core.extensions.DjangoContext and
> prefill it with your everpresent variables in __init__().
I ended up subclassing "Context". I was wrong when I said writing a
custom Context doesn't seem to save code -- passing MyContext(request)
to render_to_response
Maniac wrote:
> You could subclass django.core.extensions.DjangoContext and
> prefill it with your everpresent variables in __init__().
I ended up writing a one-line custom middleware that makes the
user-instance available to my views as request.user. In order to have
the user-data not only in th
Andreas wrote:
mentioned that I don't, I'm using a custom model. Is there a way to
make a custom model available in all views and templates without
explicitly passing it as a parameter every time?
You could subclass django.core.extensions.DjangoContext and prefill it
with your everpresent v
Jacob Kaplan-Moss wrote:
> If you use django.core.extensions.DjangoContext instead of
> django.core.template.Context the {{ user }} variable will
> automatically be available in your templates. If
> {{ user.is_anonymous }} is True then the user is *not*
> logged in; otherwise the user info is ava
On 10/4/05, Jacob Kaplan-Moss <[EMAIL PROTECTED]> wrote:
> On Oct 4, 2005, at 8:42 AM, Andreas wrote:
> > What's the best way to check if a user is logged in on every page
> > (read: view) of a website? I'd like to be able to display the username
> > in the template if a user is logged in. At the
On Oct 4, 2005, at 8:42 AM, Andreas wrote:
What's the best way to check if a user is logged in on every page
(read: view) of a website? I'd like to be able to display the username
in the template if a user is logged in. At the moment, I'm using the
following code:
If you use django.core.extens
6 matches
Mail list logo