Anonymous
With the help of api gateway you send external requests, you can send 202 from django
Anonymous
The question that I'm asking is how to do in django? When request comes to post method, we send a response 202 and then start processing
Rohan
Rohan
Etc
Rohan
Even simple async
Rohan
But celery is a bit more configurable
Rohan
Kafka is yet another scalable solution but it’s an extra step for infrastructure
Anonymous
عبید اللہ
Contact.html file
konstantin
Guys, I want to redirect output from real-time console to a page in Django, for example in textarea with autoscrolling.
What's the best way to do this?
Google search didn't give a clear answer... maybe I should use Websockets and Channels or Celery and Redis...
Frez
for this models
class Shop(models.Model):
name = models.CharField(max_length=200)
class ShopEventHistory(models.Model):
shop_object = models.ForeignKey(Shop, on_delete=models.CASCADE, related_name='events')
event = models.CharField( max_length=100, choices=EVENT_CH, null=True, blank=True)
date = models.DateTimeField( db_index=True, auto_now_add=True)
How I can found last event for every shop in one query?
Michael the wolf 🐺
add a method to shop to fetch last event item stored in histry model , then you use Shop.query to get that
Frez
#me {display: none;}
last_events = ShopEventHistory.objects.order_by(“shop_object_id”, “-date”).distinct(“shop_object_id”)
#me {display: none;}
Emm, sorry , but it works in postgre
Frez
λ701
#me {display: none;}
It’s only for one shop
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like:
- https://del.dog
- https://dpaste.org
- https://linkode.org
- https://hastebin.com
- https://bin.kv2.dev
If you posted a wall of text, go back and delete it.
Pavan
fn
Hi all (again)!
Please if anybody knows, need little help!
https://stackoverflow.com/questions/69804457/how-to-get-a-value-of-foreign-key-between-apps-of-django
William
Vaibhav
Deleted
pls help: https://stackoverflow.com/questions/69805615/pass-field-to-distinct-in-django
180030282_N.Sai Charitha
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': 'project',
'USER':'root',
'PASSWORD':'root',
'PORT':'3306',
'OPTIONS':{
"init_command": "SET default-storage-engine=INNODB;",
}
}
}
database related code in settings.py
180030282_N.Sai Charitha
django.db.utils.ProgrammingError: (1064, "You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '-storage
-engine=INNODB' at line 1")
Getting the above error.
Can someone help me to resolve this.
Bruce
try this, add the followin to __ini__.py or settings.py of you project:import pymysql
pymysql.install_as_MySQLdb()
Mykhailo
Hello guys! I am trying to execute the following command: python manage.py dumpdata --indent 2 > db.json, but I get an error in response:
Exception ignored in: <generator object cursor_iter at 0x000001A193207580>
Traceback (most recent call last):
File "...", line 1649, in cursor_iter
cursor.close()
sqlite3.ProgrammingError: Cannot operate on a closed database.
Tell me, what could be the matter?
Sanjarbek
can a website created on #django be inserted into #vestacp?
Dinesh
Im looking for help
Dinesh
django.core.exceptions.ImproperlyConfigured: WSGI application 'DjangoAPI.wsgi.application' could not be loaded; Error importing module
Dinesh
Hossein.A
Hi
Does anyone Django code programming into Mac(iMac)?
Maxim
इमरान عمران Imran
has anyone integrated ckeditor?
IDK
इमरान عمران Imran
I'm getting html tagged code snippets, how to fix it
IDK
do you know about autoescape tag in jinja
इमरान عمران Imran
{{ }}
IDK
if {% autoescape off %} set it will show script or code
IDK
try to set {% autoescape on %} {{there is your element}} {% endautoescape %}
John
Hi, is there a way to use callable in django admin instead of model field?
lets say I have a model with field "usefull_info", can I use a django admin method with same name?
Anonymous
Pavan
Rohit
Hi everyone,
I am filtering a a record in the db. Querystatment looks like
Model name.object.filter(column-name__icoontains=string)
The problem is db query that take more than 5 sec. Will not be executed . As there are so many records.
When I doing like this stmt is executed.
name.object.filter(column-name__icoontains=string)[: 10000]
I need all the records if the string is matched
I need to get all the records and perform operation on that. Can u please help how I can get all the data in chunks.
Rohit
Thanks
Hossein.A
Anonymous
Zakx
What is channel In django and why it is used?
Mirco
Hossein.A
Doragonsureiyā
No one?
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 😊
Shilpy
hamed
Hi everyone
I asked this question on stackoverflow:
https://stackoverflow.com/questions/69809599/remotely-served-django-service-does-not-return-response-for-patch-requests
Anybody has an opinion???
Maxim
hamed
find out what event causes the HTTP 400 status
It is not related, the http response by 400 status code never arrives, this is the whole point, no matter what is the response that django have generated it will never get out of it
Maxim
hamed
[02/Nov/2021 11:18:25] "PATCH / HTTP/1.1" 400 62827
400 is response HTTP status here
This is literally what I am trying to say, this is the log that django creates and shows that it 1. received a request, 2. processed it, 3. Sended back its response
And I as a client that uses Curl to send the request, never have catched the response,
What happend between the django view and my client???
Is my question this much ambiguous or you are not reading it carefully??🤔
I am not native so...
k
any one familat with celery
benshi
HEY GUYS
Anybody knows the best way to still be running your code even after the server dies?
λ701
λ701
λ701
λ701
benshi
benshi
Anonymous
Crontab might not help, instead have a shell script running in background which keeps monitoring the process. When ever the process dies restart it. But it won't help in ur number generator
Anonymous
Anonymous
Try to figure out under what scenario the code is crashing
benshi
Anonymous