django channels consumers

2020-08-11 Thread Vahid Asadi
Hi there. i want to send a message though WebSocket protocol after a user disconnected from the channel. the consumer codes is located on this link. https://paste.ubuntu.com/p/GND7tqVB6q/ the main function that sends a message to the group after a user disconnected is `chat_leave` function. th

UNIQUE constraint failed on adding a new model field

2019-10-30 Thread Vahid Asadi
HI . when i want to add a new field called "slug" to my "Post" model, the migrate command will raise UNIQUE constraint failed: new__chat_post.slug after that i remove that field from my model but the problem still exists. why?? and how to resolve this problem without deleting my whole table d

Re: confusing about running some codes in django

2019-08-29 Thread Vahid Asadi
however, you > could also include it pretty much anywhere in your code. > > > On Wednesday, August 28, 2019 at 9:15:20 AM UTC-4, Vahid Asadi wrote: >> >> Hi . >> when i read the django docs,it suggested that running some code but it >> does not note that where to wr

Re: confusing about running some codes in django

2019-08-29 Thread Vahid Asadi
Thanks -- 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+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google

confusing about running some codes in django

2019-08-28 Thread Vahid Asadi
Hi . when i read the django docs,it suggested that running some code but it does not note that where to write this piece of code . the code is : from django.contrib.auth.models import User u = User.objects.get(username='john') u.set_password('new password') u.save() i know that i can run it