Hamidreza
@receiver(post_save, sender=account)
def update_table(sender, instance, **kwargs):
try:
loop = asyncio.get_event_loop()
except RuntimeError:
loop = asyncio.new_event_loop()
coroutine = channel_layer.group_send('statistics',{'type': 'chat_message','user': {"phone":instance.phone}})
loop.run_until_complete(coroutine)
When I update one of the fields in the admin panel
This function works properly
But when several users work together, I get the following error
RuntimeError: Cannot close a running event loop
How do I solve this problem?
Django Channel | WebSocket
Anonymous
Bhashkar
Hi anyone can help me ?
For now i am using cmd (uwsgi --ini uwsgi.ini ) for nginx <-> socket <->uwsgi <—>djnago
And when i close terminal it terminated goodbye to uWSGI..
So i want to run this command once forever ?
Mirco
Mirco
But locally you don't need to run Django by using uWSGI
Shreehari
Alex
Mirco
Bhashkar
Hamidreza
Bhashkar
Shreehari
Alex
yes
You can launch it with daemonize key. In your case smt like uwsgi --ini uwsgi.ini --daemonize /tmp/mylog.log
Alex
Bhashkar
in production uwsgi interface is good for django ?
Bhashkar
nginx + uwsgi + supervisor good for django if deploying .
Dni
hi guys
what i must put in
USERNAME_FIELD = ' '
Dni
to set username for identifire
Dni
https://del.dog/dnidjangoerror.txt my code
Anonymous
I want best books in python
Alex
Anonymous
It's available I guess if I m not wrong ?
Anonymous
https://www.pythonkitchen.com/legally-free-python-books-list/
Anonymous
Try this
Deku
Can anyone help me by guiding me how to copy code field in Tinymce to code field in ckeditor with having extra spaces and other space problems!
Please help if anyone has experience with this!
Deku
Agadmator
<li class="nav-item mr-2">
<button
class="nav-item btn btn-outline-info"
onclick="window.open( '{% url register %}' , '_blank');"
style="font-family: Yekan;" > Register
</button> </li>
Agadmator
hey guys - I couldn't send picture of the error
Agadmator
but what is my mistake in the 4th line? I mean the onclick part?
Doragonsureiyā
Sergey
I have a URL, how can I find url pattern from urls.py?
Sergey
Alex
It shows only namespace for URL
Read carefully. No, it returns much more
https://docs.djangoproject.com/en/3.1/ref/urlresolvers/#django.urls.ResolverMatch
Sergey
Alex
Sergey
I have a URL match but I can't find where the URL parent for this match was created
Aravind
Can any one tell how to add a customized bootstrap template for login and signup page
Dni
Mirco
Mirco
Alex
guys pls help
It should be a name of one of your fields that you consider a username
https://docs.djangoproject.com/en/3.1/topics/auth/customizing/#django.contrib.auth.models.CustomUser.USERNAME_FIELD
Dni
username
User has no field named 'username'
Dni
Dni
Dni
Dni
but how can i use that ?
Alex
django by default have a username field
You are using AbstractBaseUser which has only a few fields
Either define username in your custom class or "step higher" and use AbstractUser
Mirco
Dni
Anonymous
Dni
Doragonsureiyā
Maybe anyone is here, yes, but they are not obliged to read everyone's message here neither to reply to everyone's message, if someone wants to reply to your message, they will do that, just don't try to draw attention to your message writing "anyone?" every 5 minutes, that will lead you to be warned for SPAM/Flood, just be patient or use Google/DuckDuckGo to research about your question instead of wasting time here waiting for people to do your work.
Have a nice day 😊
Anonymous
Guys, I have created a User Model. They can be of two professions, Student or teacher.
Now I have created another Model which is PROJECTS.
GOAL: I want to enable Teachers to create a New project and assign to multiple Students. How do i implement this?
Just guide me. Coz I want to create an object or instance of Project class and assign it to multiple objects of Student class objects.
How to do this?
Nikhil
R
Hi All
I have an existing Oracle database and data in tables will be updated every minute.
How do I use that table in Django ...to fetch the data??
Please provide your inputs on this
.
Change the credentials accordingly (:
.
If you already did the connection and if you're trying to fetch the data then just follow the basic django ORM commands
.
This blog might help Ravi
http://www.srikanthtechnologies.com/blog/python/django_oracle_orm.aspx
Anonymous
Do anyone have idea how to extract data from resume?
Gamma
I can't connect my python with mysql
Charly
Meghna
I’m trying to search through multiple fields using query
At first I was passing multiple values in .filter() but it wasn’t working, after that I tried multiple .filter() for different values but it only searches from the first field even after adding into context. How to correct it? Please help.
DD
Hello, guys. I'm trying to get the full url of my FileField, but it's not actually working. I found the solution of Django REST docs - add the context={'request': request} to serializer, but it doesn't working too. Any advices please?
Michael the wolf 🐺
Which library is good to implement SSO ? I mean a single server and multiple clients.
winnythepooh
Hi django tastypie is dehydrate is the best method to get different types of requests
winnythepooh
Or is there any other approach?
enansi
Hi All, In my DRF application, I have a ModelSerializer. And when I do a PATCH on an endpoint that uses that ModelSerializer I need to include a non-model field (i.e. a field that is not in the Model).. how do I get this to appear in data or validated_data?
Mirco
ITz_Ayi
I tried to make migrations after working on my models.
Changes were detected but migration failed.
I got this error "Django.db.utils.IntegrityError: The row in table 'product_category' with primary key '2' has an invalid foreign key: product_category.parent_id contains a value '0' that does not have a corresponding value in product_category.id."
Please how do i solve this?
Doragonsureiyā
Michael the wolf 🐺