https://realpython.com/blog/python/asynchronous-tasks-with-django-and-celery/
$ pip install celery
$ sudo apt-get install rabbitmq-server
| repos: | |
| - repo: https://github.com/pre-commit/pre-commit-hooks | |
| rev: v4.0.1 | |
| hooks: | |
| - id: check-yaml | |
| - id: end-of-file-fixer | |
| - id: trailing-whitespace | |
| - id: debug-statements | |
| - repo: https://gitlab.com/pycqa/flake8 |
| #!/bin/bash | |
| NAME="hello_app" # Name of the application | |
| DJANGODIR=/webapps/hello_django/hello # Django project directory | |
| SOCKFILE=/webapps/hello_django/run/gunicorn.sock # we will communicte using this unix socket | |
| USER=hello # the user to run as | |
| GROUP=webapps # the group to run as | |
| NUM_WORKERS=3 # how many worker processes should Gunicorn spawn | |
| DJANGO_SETTINGS_MODULE=hello.settings # which settings file should Django use | |
| DJANGO_WSGI_MODULE=hello.wsgi # WSGI module name |
| rabbitmqctl add_user test test | |
| rabbitmqctl set_user_tags test administrator | |
| rabbitmqctl set_permissions -p / test ".*" ".*" ".*" |
| ; ================================== | |
| ; celery worker supervisor | |
| ; ================================== | |
| [program:celery] | |
| command=/path/to/home/.virtualenvs/celery_env/bin/celery worker -A app.celery --loglevel=INFO | |
| directory=/path/to/home/celery-scheduler | |
| user=root | |
| numprocs=1 |
https://realpython.com/blog/python/asynchronous-tasks-with-django-and-celery/
$ pip install celery
$ sudo apt-get install rabbitmq-server
| 1. django (latest version) | |
| $ pip install django | |
| 2. celery (latest version) | |
| $ pip install celery | |
| first steps | |
| docs: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html | |
| install celery extension | |
| $ pip install django-celery-beat | |
| docs: http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html#django-celery-beat |
Source: https://www.toptal.com/python/tips-and-practices
This resource contains a collection of Python best practices and Python tips provided by our Toptal network members. As such, this page will be updated on a regular basis to include additional information and cover emerging Python techniques. This is a community driven project, so you are encouraged to contribute as well, and we are counting on your feedback.
Python is a high level language used in many development areas, like web development (Django, Flask), data analysis (SciPy, scikit-learn), desktop UI (wxWidgets, PyQt) and system administration (Ansible, OpenStack). The main advantage of Python is development speed. Python comes with rich standard library, a lot of 3rd party libraries and clean syntax. All this allows a developer to focus on the problem they want to solve, and not on the language details or reinventing the wheel.
Check out the Toptal resource pages for additional information on Python. There is a Python hiring guide, Python job
Python 3 resources, unless otherwise noted
Check out Basic concepts and features tutorial and Getting Started from Python official website
NOTE: Fork of https://github.com/learnbyexample/scripting_course/blob/master/Python_curated_resources.md