Authorize them against the DB the first time, then attach some flag to
their session that represents "authorized" that your views check on
instead of having them work with the auth models (or however you're
doing it). If the "authorized" flag doesn't exist, redirect them to
the login page.

You may also be interested in reading about memcached and how to
configure Django to work with it; it's cut back a lot of my own
database hits.

Russ B.

On Nov 16, 10:34 pm, Jani Tiainen <rede...@gmail.com> wrote:
> Hi,
>
> I've application that uses ajax and most of my views are protected by
> @login_required decorator, some of them with additional permissions.
>
> Problem is now that I get lot of hits to database to check rather static
> credential information.
>
> Is there way to cache these credentials so that I would hit database more
> infrequently?
>
> --
>
> Jani Tiainen

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-us...@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.

Reply via email to