1

I am following this solution to show whether a user is online or not. But when I try to add:

 'userprofile.middleware.ActiveUserMiddleware',

to MIDDLEWARE_CLASSES, I get a 502 error.

{{ profile.online }} returns false.


Thank you for any help.


UPDATE

It seems to work now without the middleware.

 {% if object.profile.is_online %}
 Online
 {% else %}
 Offline 
 {% endif %}

I have a list of users called "recommended".

{% recommended request user %}

Can I check within the template if these users are online?

{% recommended request user.is_online %}

does not work.

Thank you for any help / resource on this topic

1 Answers1

0

I found a solution.

Django-online-users works perfectly fine.