Deploying a Celery Project
I'm attempting a proof of concept for sending emails using celery on railway.app. If I can show this working then we will integrate this into our actual project. I found a simple github and how to and set it up locally with it pointing to redis on railway.app (since you guys are nice enough to provide quick spin up on it). The instructions I have tell me do the following three commands in individual terminals. It works and starts sending emails with a scheduled task. Note, this is just sending email reports for users of our app. It's not a mass emailing system.
python manage.py runserver
celery -A main worker --pool=solo -l info
celery -A main beat -l INFO
So I have gathered that I need to setup my Procfile correctly for this to work on railway.app.
My Procfile looks like this:
release: python manage.py migrate
web: gunicorn main.wsgi --log-file -
worker: celery -A main worker --pool=solo -l info
I was trying to find documentation on Procfile and how it works, but find myself resorting to trying examples. How would I do the last terminal service 'celery -A main beat -l INFO`? Do I just make another line and tag it with worker: in the front? Is that a label or a pre-defined tag?
Any help would be appreciated!15 Replies
Project ID:
N/A
You might find these helpful:
- Celery Worker Not Working
- Celery tasks not executing
- Django + Celery + beat
⚠️ experimental feature
I don't know where to find the project id, but this hex number is next to the project name.. 9bddd44
Can you drop me a link to your project?
that way I can jump in and look at it
My project id is 894893d5-5281-4ff7-85b1-5eab800fcda1
Cool: one thing off the bat is you can't send emails off Railway because of GCP port stuff (our provider)
but going to dig in
What it is doing is using gmail to send the email. Is that allowed?
my github project is https://github.com/Surgeapp35/celery-send-email.git
GitHub
GitHub - Surgeapp35/celery-send-email: Celery Proof of Concept
Celery Proof of Concept. Contribute to Surgeapp35/celery-send-email development by creating an account on GitHub.
from django.core.mail import send_mail
yea...
Django in this case is trying to spin up a mail serverso basically we can't use railway.app to send any emails to users? Just making sure as it will impact our hosting decisions.
You would have to use Mailgun or Postmark.
Sorry about that 😢
those services allow you to send an email's info to them via api and they will send for you?
Yep
and they handle mailer rep too
ok well thank you for your time Angelo
No problem, thank you for considering us!