WSGI mod, Python, Django, Celery and a nice fella virtualenv

Here I’ll show how to use Python (3.8.0 in the current example, but legit for latest 3.+ versions, not for os.name == ‘NT’) and virtualenv to setup WGSI enabled website on Django (or any) with implemented Celery + Flower + RabbitMQ. This example is my own path used for automated test framework: Octopus (not available now, but have dev branch opened: Lobster) Here only configurations and setup for Python 3.8.0, virtualenv, WSGI, Django, Celery (worker and beat services), Flower and that’s it. Later I’ll show Django + Celery configuration when they run together (sort of). You may want to install Python at first: Read When your modern and fancy python is installed, we’ll make a virtual environment for our website.Short Read more…

Test automation or: How I Learned to Stop Worrying and Love Async __init__

octopus_main_page

Morning everybody… I recommend reading this part of the blog only in the morning with a cup of dark and strong coffee. I’ll show you some new cases, and howto’s to help you automate routines in the developer’s life. There will be an example of my fails and win on different scenarios. The poor code I’ll include also. Very beginning Firstly – I’ll try to make this thread in English. And maybe later when I have time – to make Ukrainian and Russian translations, I’ll make them. “Octopus” story has started from a small plugin for Sublime Text editor. Later it will be ported to Atom. I’ve started developing “Octopus” on spring-summer 2016, and I’ve not finished it yet! New functionsShort Read more…

Python – Django Celery – кейс длиною в вечность.

Вкратце: когда добавляешь пачку тасок на Celery worker’ы, случается так, что парочка из них отваливается или засыпает или еще чего. Долго не доходили руки поправить это недоразумение, поэтому я просто рестартовал все воркеры раз в пару дней или прямо перед началом проверки рутины, в общем очень сложно было поймать и воспроизвести тот случай, когда без каких-либо ошибок воркер просто молчал. И наконец дошоли руки запилить кривофикс, время покажет насколько он толковый, суть в следующем: В сразу после момента определения свободного воркера  – запускать app.control.heartbeat() и app.control.ping(timeout=10) и если ответ пришел (в виде [{‘alpha@host’: {‘ok’: ‘pong’}}]) – значит воркер готов и можно передавать ему таску, пачку тасков, рутину и тп. Если ответ пришел отличным от этого – даем ошибку и ничего не запускаемShort Read more…