DEV Community

Discussion on: Happy birthday Django! 🎂

Collapse
 
zubairmohsin33 profile image
Zubair Mohsin

Just started learning Django.
Coming from Laravel, only thing I miss is native Jobs/Queues for background processes.

Collapse
 
rhymes profile image
rhymes • Edited

Just started learning Django.

Nice!

Coming from Laravel, only thing I miss is native Jobs/Queues for background processes.

They are not native indeed but I suggest you look at django-rq which as far as I know are still one of the simplest ways to add a queueing system to a Django application.

Collapse
 
zubairmohsin33 profile image
Zubair Mohsin

Yeah I found it while doing my research. Thanks.

Is it only possible to enqueue functions? 🤔

Thread Thread
 
rhymes profile image
rhymes

What do you mean?

Thread Thread
 
zubairmohsin33 profile image
Zubair Mohsin

In Laravel we have Job classes which we dispatch. But in django-rq, it seems like it's only possible with functions.

Thread Thread
 
rhymes profile image
rhymes

If there's one thing I learned by using multiple programming languages in my career is not to try to bend one framework to be similar to another. Just embrace it :-)

Django is (mostly) function based, I think it's normal that django-rq is as well.

Are you having specific issues/limitations with using django-rq as is?

Thread Thread
 
zubairmohsin33 profile image
Zubair Mohsin

No not really. A Django codebase has just been thrown at me 😅
There's a module which sends number of emails so I thought why not do it in background.
Right now, I am just trying to figure out things using Laravel knowledge and googling.

Thread Thread
 
rhymes profile image
rhymes

Good luck :)

Thread Thread
 
zubairmohsin33 profile image
Zubair Mohsin

Thank you 🙏

Collapse
 
mx profile image
Maxime Moreau

You can also take a look at Celery (docs.celeryproject.org/en/stable/), such a great piece of software, and the integration with django is really smooth.

Collapse
 
zubairmohsin33 profile image
Zubair Mohsin • Edited

Does it offer a GUI/dashboard where we can see how our jobs are doing like in django-rq??
Also, do you find it easier to maintain in production?

Thread Thread
 
rhymes profile image
rhymes • Edited

Celery has flower.

I personally think Celery is a bit over-engineered and not all backends are as developed as the others. It's a solid tool though. I used it to process millions of images, Instagram used it for years (they probably still do, but I'm not up to date). The two things are unrelated :D

I think it's a bit more complicated to maintain in production than RQ because it does so many things and can use different combinations of backends.

A good way of choosing: do you need RabbitMQ for complicated queue topologies or need to basically build trees of subtasks? If yes, use Celery, otherwise you can stick with RQ which by only supporting Redis makes it all a bit easier.

As always, it depends on what you need :)

Thread Thread
 
mx profile image
Maxime Moreau • Edited

We can use Flower to have nice visualizations (flower.readthedocs.io/en/latest/sc...) or RabbitMQ admin if we're using Rabbit as backend (Redis can also be used).

Also, do you find it easier to maintain in production?

I don't know as I don't have any experience with django-rq