This is standard practice on monolithic apps. It is effectively an N-tier architecture. On Rails it is very expected that you would deploy the same codebase to two tiers (web and worker) and simply run rails s in one and sidekiq in the other.
Ditto in Django + Celery
Anyone using a more modern/lightweight alternative to Celery?
If you're using PostgreSQL, then
django-postgres-queue: https://github.com/gavinwahl/django-postgres-queue
procrastinate: https://github.com/procrastinate-org/procrastinate/