Comments (1)
I solve it by silly way
I passed ID in the url like http://127.0.0.1:8000/chat/?id=[id]
and in user list
passed id to the list
class UsersListView(LoginRequiredMixin, ListView):
http_method_names = ['get', ]
def get_queryset(self):
return UserModel.objects.all().exclude(id=self.request.user.id)
def get_user_profile(self, *args):
usr = self.request.META['HTTP_REFERER'].rsplit('=', 1)[1]
print(usr)
return usr
# def get_context_data(self, **kwargs):
def render_to_response(self, context, **response_kwargs):
users: List[AbstractBaseUser] = context['object_list']
user_profile = int(self.get_user_profile())
# print(user_profile)
for user in users:
if user.id == user_profile:
data = [{
"username": user.get_username(),
"pk": str(user.pk)
}]
return JsonResponse(data, safe=False)
then I do jquery things to click in list then click to user then hide list..
Thank you for amazing project really I like it.
If could Implement in the easy way it will be a awasome, like make specific view takes id who want to chat with.
from django_private_chat2.
Related Issues (20)
- User Dialogs Limit / User HOT 3
- 413 Request Entity Too Large for URL HOT 3
- Responsive Chat HOT 2
- Bug Report: Failed to Implement the Example on Django 4.0 HOT 4
- Blocking users
- Django Rest Framework Simple JWT getting anonymous user HOT 1
- How customize background template in my project ? HOT 1
- i want to use ssl HOT 1
- Group Chat 1:n HOT 6
- Users not loading. HOT 2
- How to deploy on server
- According to Quickstart configuration, no front-end page is opened HOT 1
- Unable to deploy my branch
- How can I change user's avatar manually? HOT 1
- Not Found: /chat_ws HOT 1
- If anyone having issue with starting the chat below are the steps to run the /chat_ws endpoint
- Documentation Url is broken HOT 1
- How to implement django_private_chat2 into my project
- The APIs are not JSON compatible
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from django_private_chat2.