public-permission profile in Django allauth

50 views
Skip to first unread message

Jun Tanaka

unread,
Nov 15, 2022, 3:10:46 AM11/15/22
to Django users

Good day team,  

I’m making a Twitter-like application. I want to make it every user can choose his tweet public or not. I use Django allauth. Maybe, there is a configuration for this?

Also, be able to access the public-permission profile link without login

If anyone knows the simplest way to accomplish this please teach me. Any Code sample is very much appreciated.

Jun

Ryan Nowakowski

unread,
Nov 15, 2022, 7:56:23 PM11/15/22
to django...@googlegroups.com
Who should be able to view the non public tweets? Just the author?

Jun Tanaka

unread,
Nov 15, 2022, 10:23:00 PM11/15/22
to Django users
Logged-in users  

2022年11月16日水曜日 9:56:23 UTC+9 Ryan Nowakowski:

Ryan Nowakowski

unread,
Nov 17, 2022, 1:30:31 PM11/17/22
to django...@googlegroups.com
If I had to solve this problem I would first add an is_public BooleanField to my Tweet model.  Then, in my tweet view, I would check is_public and if it's not then check request.user.is_authenticated[1].

[1] https://docs.djangoproject.com/en/4.1/topics/auth/default/#authentication-in-web-requests

subin

unread,
Nov 19, 2022, 3:48:43 PM11/19/22
to django...@googlegroups.com
Thanks again for bringing this matter to my attention.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/A6B205C6-024B-4AC6-9D5B-BAF73AD97C35%40fattuba.com.
Reply all
Reply to author
Forward
0 new messages