Skip to content

Rustem/toptal-blog-celery-toy-ex

Repository files navigation

Celery Uncovered

Supporting project for my TopTal article.

This repository is intended to help the beginners better understand celery by usecases. It also shows some really nice (undocumented) tricks that could give lots of benefits while developing celery-based projects.

Built with Cookiecutter Django

License

MIT

Django-Applications ------------

toyex ^^^^^^

contains widely used (simple) examples of using celery to solve background tasks

advex

contains generic patterns of using celery to facilitate workflow execution and many others (soon)

tricks ^^^^^^^

contains generic examples of extending default `celery.app.Task` and some undocument tricks such as:
  • verbose logging
  • scope injection
  • freezing task

Extra Details

Celery

This app comes with Celery.

To run a celery worker:

cd celery_uncovered
celery -A celery_uncovered worker -l info

Please note: For Celery's import magic to work, it is important where the celery commands are run. If you are in the same folder with manage.py, you should be right.

Email Server

In development, it is often nice to be able to see emails that are being sent from your application. For that reason local SMTP server MailHog with a web interface is available as docker container.

With MailHog running, to view messages that are sent by your application, open your browser and go to http://127.0.0.1:8025

How to deploy and run it via docker you can refer to its [README.md](docker/mailhog/README.md).

Further configuration options are available in MailHog.

Running tests with py.test

$ chmod +x utility/unittest.sh
$ ./utility/unittest.sh

Live reloading and Sass CSS compilation

Moved to Live reloading and SASS compilation.

Deployment

The following details how to deploy this application.

Credits ------

About

Supporting project for my toptal article

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published