Shivani
How to add functionality of remember me in django login with multiple user type
Becky
Is there any one have note about Django python
ניקיטוס
Hello there! I need to connect telegram bot to the django app and for now i can`t figure out what is the best way to do it. For now i see 2 options, which is using webhooks and embedding bot into the app and use it from there.
Alexey
Tamerlan
I get error TypeError: object ChatConsumer can't be used in 'await' expression
Tamerlan
that is my consumer
theDisgrace
Try inheriting AsyncWebsocketConsumer instead of sync version
Tamerlan
In video author use sync version that is why i use this
Tamerlan
I am new about use channels
theDisgrace
Maybe you've used await with it.. instead of that try using async_to_sync
theDisgrace
Or just remove await if it's not necessary
Tamerlan
i do not use await
theDisgrace
I'm not sure but I don't think the problem is in this part of code.. maybe it's view or models.. have you used the ChatConsumer in the python code anywhere?
Tamerlan
https://linkode.org/#U4BeNfTL2qVoIiLp1tGKo3
Tamerlan
Tamerlan
In url
Asad Ullah
what does this function do on autocall?
reference: https://docs.djangoproject.com/en/4.1/ref/contrib/admin/#django.contrib.admin.autodiscover
Izbash
Oxytocin
Hi
I have a class named notification that I want to create a notification if the m2m field of an object from another class is changed.
m2m field is actually assigned users.
I used Django's m2m changed signal, but it returns auth.user.None
How can I get the id of added or deleted users and create a notif for them??
Garegin
hi, how to can I fix migration conflicts?
Maxim
Garegin
Garegin
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0008_alter_user_username_max_length 2, 0011_update_proxy_permissions 2, 0010_alter_group_name_max_length 2, 0007_alter_validators_add_error_messages 2, 0003_alter_user_email_max_length 2, 0004_alter_user_username_opts 2, 0009_alter_user_last_name_max_length 2, 0012_alter_user_first_name_max_length, 0005_alter_user_last_login_null 2, 0002_alter_permission_name_max_length 2, 0012_alter_user_first_name_max_length 2, 0006_require_contenttypes_0002 2 in auth; 0003_logentry_add_action_flag_choices 2, 0001_initial 2, 0002_logentry_remove_auto_add 2, 0003_logentry_add_action_flag_choices in admin; 0002_remove_content_type_name 2, 0001_initial 2, 0002_remove_content_type_name in contenttypes; 0001_initial, 0001_initial 2 in sessions).
To fix them run 'python manage.py makemigrations --merge'
cj
CommandError: Conflicting migrations detected; multiple leaf nodes in the migration graph: (0008_alter_user_username_max_length 2, 0011_update_proxy_permissions 2, 0010_alter_group_name_max_length 2, 0007_alter_validators_add_error_messages 2, 0003_alter_user_email_max_length 2, 0004_alter_user_username_opts 2, 0009_alter_user_last_name_max_length 2, 0012_alter_user_first_name_max_length, 0005_alter_user_last_login_null 2, 0002_alter_permission_name_max_length 2, 0012_alter_user_first_name_max_length 2, 0006_require_contenttypes_0002 2 in auth; 0003_logentry_add_action_flag_choices 2, 0001_initial 2, 0002_logentry_remove_auto_add 2, 0003_logentry_add_action_flag_choices in admin; 0002_remove_content_type_name 2, 0001_initial 2, 0002_remove_content_type_name in contenttypes; 0001_initial, 0001_initial 2 in sessions).
To fix them run 'python manage.py makemigrations --merge'
in the last line, django itself tells you what to do to fix them...
but, as you were said, it is better to remove the migrations you made in your branch, rebase from the develop branch and create the migrations again
Maxim
cj
Mirco
Hemraj
Is there any “approval form workflow” method in django which can be used by assigning users?
Eman
how can i solve duplicates in SQL in many to many relationship in rest framework
Patrick
Eman
handle my views remove duplicates and similar queries
Eman
Charly
VisioN
.
Use modelname.objects.all().distinct('category')
Eman
SELECT ••• FROM Hospital_patient WHERE Hospital_patient.id = 1 LIMIT 21
7 similar queries. Duplicated 7 times.
Patrick
if you have model with variable might have duplicate then...
#collect duplicate first
from django.db.models import Count
duplicates = model.objects.values('some_variable').annotate(Count('id')).filter(id__count__gt=1)
#then keep 1 and remove others by
for duplicate in duplicates:
queryset = model.objects.filter(some_variable=duplicate['some_variable'])
queryset[1:].delete()
Eman
ManDo
Hello! How can I use annotate and subquery with 2 tables in 2 different databases?
Charly
Tamerlan
Hello everyone
Tamerlan
I never deployed project and I will have to do that in the future. I want deploy project to digitial ocean can you give me advise to start. what do i need to know for that or about how do it
Tamerlan
Tamerlan
Charly
I want advise
My advise is: do some research there are many toturials out there, then if you have, come with specific questions
Tamerlan
Every tutorial use linux
Tamerlan
But i use windows that is why I'm in trouble
Charly
No one will recommend to deploy on windows, ans it will be more expesinve
Tamerlan
Okey thanks
Ernazarova
Doragonsureiyā
what is Linux, can you enlighten me
Your question is not related to Django.
If it's a Python related question go to @Python group, otherwise please move to @PythonOfftopic group and ask there.
cj
Thomas
How to create a template for blog in Django ?
Charly
Doragonsureiyā
Give me the details where to start
Looking for Django tutorials? you can follow these three recommended ones:
* Official documentation and tutorial
* Tutorial from MDN
* Tutorial from django-girls
Ravi
How to use Token based google authentication system using as backed in django
Alexey
cj
مريم خالد
can someone tell me how can I convert the socket to endpoint so that can be consumed by the mobile app team
Alexey
مريم خالد
Can djangochannelsrestframework do package do this ?
Alexey