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
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
But locally you don't need to run Django by using uWSGI
Alex
yes
You can launch it with daemonize key. In your case smt like uwsgi --ini uwsgi.ini --daemonize /tmp/mylog.log
Alex
You can launch it with daemonize key. In your case smt like uwsgi --ini uwsgi.ini --daemonize /tmp/mylog.log
Or even better - use systemd https://uwsgi-docs.readthedocs.io/en/latest/Systemd.html
Bhashkar
in production uwsgi interface is good for django ?
Alex
in production uwsgi interface is good for django ?
what do you mean? The application server it self?
Bhashkar
nginx + uwsgi + supervisor good for django if deploying .
Alex
nginx + uwsgi + supervisor good for django if deploying .
Currently it is considered better to use systemd over supervisor for it is standard in modern unix.
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
I want best books in python
Download pdf of automate the boring stuff of python
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
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!
Like when I directly copy the field values and save the alignment of code part gets changed its ok if code is of C of java but incase of python it will make errors for users.
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ā
hey guys - I couldn't send picture of the error
Read the rules before any activity: @PythonRules
Sergey
I have a URL, how can I find url pattern from urls.py?
Alex
I have a URL, how can I find url pattern from urls.py?
https://docs.djangoproject.com/en/3.1/ref/urlresolvers/#resolve route attribute.
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
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
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
ok i know that but i want to use username for identifier
django by default have a username field
Dni
but how can i use that ?
Alex
User has no field named 'username'
Then you have to define it. It may be a charstring, email or whatever you want
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
User has no field named 'username'
AbstractBaseUser has no username field, you have to define it
Anonymous
gg ty
are you alive bro?
Dni
are you alive bro?
i think ... no
Anonymous
i think ... no
come to my pv
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?
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
.
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
DATABASES = { 'default': { 'ENGINE':'django.db.backends.oracl', 'NAME': 'XE', 'USER': 'hr', 'PASSWORD': 'hr', 'HOST': 'localhost', 'PORT': '1521' } }
.
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
Do anyone have idea how to extract data from resume?
that seems to be something that is not acomplishable with django
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?
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?
Michael the wolf 🐺