Eman
Eman

Reputation: 127

from a single user to multiple users Django app

i have a chatbot web application that simulate a customer service, where it takes the input and shows the output via request/response and some back-end python files.So far it is working for one user at a time. Now i want it to talk to multiple users at the same time where each user has his/her chatting page and cabot application. i found out that i should use:

  1. Django multi-session==> to create a session for each user.
  2. Sub-process==> to create a chatbot app of each user session.

The problem i don't know how?!. So,if these any resource to example on how to implement it that will be very helpful.

PS: i'm using Django 10.1,Python3 and new in the Django development field.

thank you,

Upvotes: 0

Views: 1377

Answers (1)

whp
whp

Reputation: 1514

I don't think you need to use either django-multi-sessions or subprocess, you may be able to leverage Django's built-in sessions framework to associate chatbot state with individual sessions. You could also use django.contrib.auth to associate chatbot state with individual users if you have each user log in. Links below.

Each request/response cycle executes independently of one another. Making some assumptions about how your chatbot works, and that its I/O passes through Django: in your view, first get or initialize the appropriate chatbot state based on the session id or user id, process the input against that state, store the persistent chatbot state for a following request/response cycle, and return the response.

https://docs.djangoproject.com/en/1.11/topics/http/sessions/

https://docs.djangoproject.com/en/1.11/ref/contrib/auth/

http://django-book.readthedocs.io/en/latest/chapter14.html

Filtering content based on users in django

Upvotes: 2

Related Questions