Pedro
Good morning, everyone! I'm running celery django and every time I run my task, it finishes, but not all memory is returned to the system and this keeps growing indefinitely. Does anyone know a way to debug or possible reasons?
Pedro
What are you using as your task broker, and results store?
Redis, but I think I found the main problem, I was testing with debug activated. I disabled it and I have less memory leak
Pedro
The pod starts with 250 to 300mb and now tun the script and go back to 550mb
Alexander
Hello, is anybody know, how to insert an update form in a list template? I have already add a create form in context as context["form"] = MyForm() and it works. For an update I need to use exactly the same form, but prefilled with previous data. I tried context["update_form"] = { record.id: MyForm(instance=record) for record in self.get_queryset() } but thats doesn't work
Bhavin
I'm working on a Django and React project, but my API request to http://127.0.0.1:8000/api/chat/ is returning a 404 Not Found error. The route is defined in backend/urls.py and chat/urls.py. Can someone help me debug this?
Alexander
Use the same file but fix a field value on the forms.py the same way you add widget ...
Can you please explain? I want to generate an "update form" with each list object <ul> <li> Object 1 {{ form }} </li> <li> Object 2 {{ form }} </li> </ul> To be honest, I don't understand how to implement it in forms.py
Programmer_Mboa
Declare your fields. As per your models. This a fields.py
Alexander
Thank you, I will try 👌🏻
Maleficent
Do you have any notes to learn Django
Doragonsureiyā
Do you have any notes to learn Django
Looking for Django tutorials? you can follow these three recommended ones: * Official documentation and tutorial * Tutorial from MDN * Tutorial from django-girls
Ibrahim Jamiu
Good day, is it worth it to learn DTL or should I just focus on DRF as a Django developer..?
cj
Good day, is it worth it to learn DTL or should I just focus on DRF as a Django developer..?
focus on the things you need to use... if you want to learn things, you can learn things, nothing stops you
GuriSandal
Hi, i am facing issue running Django app on server. When I open any it stop the server without any error show. Could anyone help me on this?
GuriSandal
I did
clouded
I did
Then there are errors.
GuriSandal
Problem is I there is no error
GuriSandal
It just stop server
GuriSandal
But migrations works fine
clouded
Problem is I there is no error
It's impossible to guess the problem, we need something to look at.
GuriSandal
Some time after performing system check... it stop
GuriSandal
INFO 2025-02-17 12:55:17,837 autoreload 24228 24644 Watching for file changes with StatReloader DEBUG 2025-02-17 12:55:17,842 autoreload 24228 24644 Waiting for apps ready_event.
GuriSandal
after this there is no logs
GuriSandal
Yes
Charly
Yes
Why you say it stops if it doesn't show a message suggesting it?
Charly
which server is?
GuriSandal
Windows server
Doragonsureiyā
Windows server
Why? Seriously... why?
Charly
Windows server
Describe your setup
Aditya
I have setup the timezone to asia/kolkata in settings And also set use tz = true But still my celery is running on incorrect timming
Aditya
Celery get timezone from server, not from project
I have checked the time on server it was correct
bibi
I have checked the time on server it was correct
setting timezone must be same with your local machine timezone
Aditya
setting timezone must be same with your local machine timezone
even on my localhost the time is wrong but when print the in django shell using localtime.now() it was perfect
Shawna
Django Channel question 🙋‍♂️ how can a person subscribe to another person profile in Django channels ? receive update from the other user when he connected he sends the users subscribe to his profile update message
Shawna
hello is very appreciated it's being very confusing for me
Shawna
Send what? Websocket event, notifications?
I don't the difference between websocket event and notifications aren't they all event handled by event handlers ?
Shawna
I reach somewhat a solution not sure if it's how it should be done by adding user group to another user group I was able to listen on to changes
ßinary403
Hello everyone 👋... any open source project available?
Mr
Any idea on the best os to host a django application
Doragonsureiyā
Any idea on the best os to host a django application
Adding the word Django to your Off-Topic question doesn't magically turn it to a Django specific question, so delete your question here and move to the @PythonOfftopic group and ask there.
M. Hossein
I have an exam model and an attempt model. Each exam has a duration, for example, 30 minutes. I want every attempt to automatically time out if its status is still "in-progress" after 30 minutes. The solution I have in mind is to create a Celery task when each attempt is created, which will check after 30 minutes and mark it as "timeout" if it's still "in-progress." Would you recommend this approach for a large number of exams? Is it reliable?
Shinny
https://dpaste.org/dGs50
Pablo
I have an exam model and an attempt model. Each exam has a duration, for example, 30 minutes. I want every attempt to automatically time out if its status is still "in-progress" after 30 minutes. The solution I have in mind is to create a Celery task when each attempt is created, which will check after 30 minutes and mark it as "timeout" if it's still "in-progress." Would you recommend this approach for a large number of exams? Is it reliable?
I assume you have some kind of frontend connected to this. What I think you can do: 1. Implement a client side countdown logic (Javascript) that will either auto submit the exam attempt on timeout or display some form of error message 2. On the server side (django), log the time that the user started the exam attempt in the attempt model and when the exam is submitted, compare the current time of submission and the time the attempt was started to see if the user finished on time. This way, you kind of have both server side and client side verification on attempts and it reduces the actual code you have to write in django that will track how long the user spent (when you mentioned celery)
Pablo
while I appreciate this, won't client side timer (your 1st option) pose a problem? What if the client is tech-savvy enough to change the script?
That is why you will have option 2 where you automatically save the time that the user starts the exam on the backend, so when the user submits, the backend also does some verification to check if the time spent is greater than the allocated time for the exam, this way you preserve the validity of the exam submissions Using options 1 and 2 together are a good fit
The Inspired
hmm, but then again, that's extra code writing...
The Inspired
But I agree. it would work
Shawna
Hey, anyone know If Django is suitable as TURN/STUN Server for webrtc
.
from django.contrib.contenttypes.admin import GenericTabularInline from . import models class TagInline(GenericTabularInline): model = Tagged_item @admin.register(models.Product) class ProductAdmin(admin.ModelAdmin): inlines = [TagInline] HEY I am encountering an error saying Tagged_item is not defined how can i resolve this without importing the Tagged_item which is on another app
The Inspired
Another app models
good. so how do you import a model from another app? in your case, if Tagged_item is inside your models, then how would you import it inside another app?
Denis
Is it possible to learn Django using only documentation?
The Inspired
Is it possible to learn Django using only documentation?
yes. 99% can be understood using the documentation
Даниил
What should be learnt before learning django?
Denis
yes. 99% can be understood using the documentation
This is incredibly difficult, maybe there are other ways to learn?
Charly
Denis
Charly
Yes , i finished today
And that was extremely difficult?
Denis
How did you study?