Files
2012-02-21 01:15:00 -05:00

1 line
3.2 KiB
JSON

[{"user_id": 3409, "stars": [], "topic_id": 37490, "date_created": 1306826206.330745, "message": "I've got a Django site, which sometimes needs users to be logged in with 2 different user accounts - at once. For example, a \"manager\" account and a \"regular ol' user\" account.", "group_id": 81, "id": 1235313}, {"user_id": 3409, "stars": [], "topic_id": 37490, "date_created": 1306826260.4477389, "message": "From what I see, Django usually assumes that every session is tied to at most 1 specific user, and that's that.", "group_id": 81, "id": 1235317}, {"user_id": 3409, "stars": [], "topic_id": 37490, "date_created": 1306826223.4178979, "message": "How can I go about doing this in Django?", "group_id": 81, "id": 1235315}, {"user_id": 3409, "stars": [{"date_created": 1306840781.6264379, "user_id": 28005}], "topic_id": 37490, "date_created": 1306827882.4383931, "message": "My example was just a simplification. My big problem is that I'm creating a widget that gets installed on various different sites, and I need distinct users for each site. Problem is, the same person browsing might have 2 different sites open at once that use my widget, so I need him to be logged in with 2 different users at once.", "group_id": 81, "id": 1235479}, {"user_id": 1127, "stars": [], "topic_id": 37490, "date_created": 1306826971.829344, "message": "The django session backend is designed for exactly what you described. If you want the user to be able to login as multiple users, and save those logins, you'd need to roll your own", "group_id": 81, "id": 1235381}, {"user_id": 13496, "stars": [], "topic_id": 37490, "date_created": 1306827778.6609631, "message": "I think trying for multiple simultaneous logins might be the wrong approach. Better to show UI elements common to both user types depending on permissions. For example if I'm logged into bucketlist.org as the admin, I see the same controls the user sees, and can operate on them as if I was them. I also see things that only admin sees, but that end users never do.", "group_id": 81, "id": 1235470}, {"user_id": 13496, "stars": [], "topic_id": 37490, "date_created": 1306828654.0627301, "message": "Interesting problem. I tend to think of a widget as something that doesn't require any login at all, but I can see this coming up if it did. No suggestions from here, but I think you're going to have a real challenge getting Django to recognize multiple simultaneous logins, unless you roll your own cookie planting.", "group_id": 81, "id": 1235601}, {"user_id": 33421, "stars": [{"date_created": 1306870222.7793031, "user_id": 4581}, {"date_created": 1306913413.9990799, "user_id": 27489}], "topic_id": 37490, "date_created": 1306832794.100563, "message": "use 2 different browsers?", "group_id": 81, "id": 1236088}, {"user_id": 1127, "stars": [{"date_created": 1306886645.831099, "user_id": 5778}, {"date_created": 1306929686.9136169, "user_id": 1243}], "topic_id": 37490, "date_created": 1306832146.863867, "message": "@edanm All it requires is setting request.user to whatever User you want to be logged in. If it's per site can you do domain specifi cookies? You can also consider just storing a list of site_id=>user_id in the users session, and then set request.user accordingly", "group_id": 81, "id": 1236027}]