Beka
sorry, I have no idea.
Mehmet
not rendering images in the email
Yes, we already have that information and try to investigate the main cause, one of the common mistakes is making a relative URL that leads to 404 error.
Mehmet
Try to render into pure html and please check your img tags one by one.
Mehmet
I have no further idea.
Zerihune
i tried rendering static images it works
Zerihune
Mehmet
Repair your syntax error in the template.
Zerihune
https://stackoverflow.com/questions/26304936/display-inline-images-in-html-email-django
Zerihune
Henoxx
Try inspecting the email element in browser and see if it has already state your image url correctly but doesn't display the image, if that is the case the email server can't access your website. Else you didn't pass the image url correctly.
Roman
Hi can I configure Celery to have 4 cron jobs that hit database and picks task or the only way is call task or sceduled?
Roman
I need something like gevent pool with 60 "threads", that works in the way that it hits database and it there is a record it picks it and start worknig on it and if so second thread wakes up and try to pick up the record if no such a record the 2 just hits the database every 2 seconds
Roman
So that the gevent has 60+ pool but if not records only 1 hits the database?
Roman
Some kind of sub to the database
Ferrum
how do i render emojis on django template?
i got the django-emoji library but i dont know how it works
Anonymous
Also, beware with gevent as it may block your app
محمد دلشاد
KJ
Guys, how fast can I learn Django if I am really serious?
cj
KJ
I see
محمد دلشاد
Anonymous
guys, I'm making a panel using django + plotly and when viewing the page, the graph is in the middle of the page and I have to scroll down to view the rest of the graph that is not visible. already tried to change the style (css) but without positive results
Anonymous
Need some help :(
Anonymous
I'm Begginer programmer in html e css, but everything is ok
Ibrahim
who tried django with flutter using rest api?
Doragonsureiyā
who tried django with flutter using rest api?
Please don't ask meta questions like:
"Any user of $x here?"
"Anyone used technology $y?"
"Hello I need help on $z"
Just ask about your problem directly! With a very high amount of people here the probability that someone will help is pretty high.
Also please read: http://catb.org/~esr/faqs/smart-questions.html
Manuel
please I need help how can I solve this
Manuel
Could not resolve URL for hyperlinked relationship using view name "evaluate:user-list". You may have failed to include the related model in your API, or incorrectly configured the lookup_field attribute on this field
Manuel
class UserList(generics.ListCreateAPIView):
queryset = User.objects.all()
serializer_class = UserSerializer
permission_classes = [permissions.IsAuthenticated]
def list(self, request):
# Note the use of get_queryset() instead of self.queryset
queryset = self.get_queryset()
serializer = UserSerializer(queryset, many=True,context={"request": request})
return Response(serializer.data)
Roman
Manuel
someone can help me please
Manuel
I'm new with django rest framework
Anonymous
Yes
I would set a flag for every entry/task in database.. something like
is_processed=models.BooleanField(default=False)
And in the task, I would filter using ...objects.filter(is_processed=False).first()
After the object is processed in the task, update it to true and save from the task
So the thread will search for available tasks in db and process the first one he finds that was not processed.. if there are not any, it just ignore in the task
Hussein
Hello
How can I build a drop-down list whose content is filtered based on another list
Hussein
Hussein
I want to do this inside the admin app
Roman
Roman
I mean all 60
Roman
I thought to create 1 infine task that will spawn another small ones
Anonymous
Like the list of provinces within a particular city
https://simpleisbetterthancomplex.com/tutorial/2018/01/29/how-to-implement-dependent-or-chained-dropdown-list-with-django.html
and load your db with https://github.com/jazzband/django-cities-light
Mirco
Doragonsureiyā
Roman
Roman
I want just 1 and if so then 2
Roman
And so on
Roman
Till the limit
Anonymous
I think that .exists() is very fast
Roman
Yeah it’s but it’s async stuff
Roman
It will kill the server
Roman
It will be like thousands hits per second to database
Roman
Anyway is it even possible define shared task thay will run “on it’s own”?
Anonymous
I think you would have to communicate between threads or use a global var so the threads would check it instead of hitting db
Roman
Just in case, when I said threads I meant Celery async ( gevent ) pool
Roman
Okay I found a solution
Roman
I can have a cron task that runs every 3 seconds, it will hit the database and get all data that should get processed and put them to the q
Roman
Then From Q celery will pick up it’s stuff
Anonymous
looks like children tasks may result in deadlocks.. but it worth a try i think..
Roman
why shall it ?
Roman
I update the flag before giving the task
Roman
Or it's not really good one ?
Anonymous
Not sure.. you are using gevent right? Just query the db from the main task, loop over results and when everything is done, update the flag
Anonymous
Like you proposed
Anonymous
People brought an image to represent my problem. When I see the graph on the page it appears cut. I already took a look at the css and I couldn't solve this problem. Follow a link with a print of the problem : https://ibb.co/CVFN4Y1
Anonymous
I don't know what to try anymore
Roman
Roman
But yeah
Roman
but if I update it first
Roman
And change the isolation level of DB
Mehmet
On default DB is used in Read Committed Isolation level for most of backends, that means when you flag one record in one worker that may not reflect for same record in another worker.
Mehmet
And that leads race condition which also mean record queueing duplication.
Mehmet
There may be some distributed locking solution that is implemented in Redis client python, as an example but that makes your structure more than complex for this kind of case.
Roman
Even If I change the iso to Repeatable read still it will create the task on top of each of them and it could get even worse
Roman
So what would to recommend ?
Mehmet
Make a research on celery queues, constraint listen operation to a certainly single worker.
Mehmet
Run another gevent worker(which has 60 gevent pools) on, of course, different celery queue, run a scheduled task on the single worker which fetches all available records, flag them as processing save and send all to 60 pooled queue as sub task.
Mehmet
Send if even your record count is more than 60. Because celery is supposed to handle that.
Mehmet
Single listener will solve your synchronization problem.