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…

Django + Python 3.4 + WAMP Apache 2.4.23 + Pycharm

Finally worked instance for hosting DEV site code on python and ability to resolve is as “on live” web server just on my laptop. A lot of different configurations changed but this is one working for me, and maybe can help you also. Better use EVERYTHING 32 bit for Window, you will suffer if you try to find some needed wheels for python 64bit on Windows 7 64bit.   WAMP Apache 2.4.23 Download: wampserver3.0.6_x86_apache2.4.23_mysql5.7.14_php5.6.25-7.0.10 Here

Download mod_wsgi.so Here or Here (for everythin 32 bit and python 3.4 on Win7 you need: mod_wsgi-py34-VC10.so)

After WAMP install – you don’t need to run full programm (I just did not see any advantages of this and disable wampmysql service) All you need is here: C:\wamp\bin\apache\apache2.4.23 Place mod_wsgi-py34-VC10.soShort Read more…

Gjango, Pycharm – static files Windows

This topic for those who broke his mind trying to understand how to make Pycharm run Django with static files I’ve made it, but be carefull it can break your mind too! The settings I use the most portable way to configure settings – so I can move it into centos web server without paths changes Win\Unix (I HOPE). There are common DIRs

Looks like ot works, but in really weird way: static files are working fine web page as template is loading some scc and js are loading and some are not Working css: In works in different ways – this is one of them which I think correct. In HTML code:

  In WEB: Working js:Short Read more…

Django fast hints

Here some fast hints to remember: Migration:

  Alias /static/ “/var/www/smm_tools/site/”   Read more…

Django static files

How to find where def. static stores?

Then move it into the folder you need. Then update django’s.conf file:

And check the settings.py:

https://docs.djangoproject.com/en/1.8/howto/static-files/   Read more…

Django + Python3.4 + Mysql(MariaDB)

Just hint for future me:

Using sources: http://www.8host.com/blog/django-prilozhenie-na-mariadb-v-centos-7/ http://stackoverflow.com/questions/14087598/python-3-3-importerror-no-module-named-configparser http://stackoverflow.com/questions/27748556/python3-4-cant-install-mysql-python http://geckich.blogspot.com/2012/08/django-djangocoreexceptionsimproperlyco.html MyOwnCommonSence     Read more…

Django + apache2 + mod_wsgi

This is conf file to allow apache run Django applications.

Use these links: https://www.digitalocean.com/community/tutorials/how-to-run-django-with-mod_wsgi-and-apache-with-a-virtualenv-python-environment-on-a-debian-vps https://www.digitalocean.com/community/tutorials/how-to-serve-django-applications-with-apache-and-mod_wsgi-on-ubuntu-14-04 https://docs.djangoproject.com/en/1.8/howto/deployment/wsgi/ Don’t forget to use correct IPs – domains, and addresses. Especially if proxy pass is used.     Read more…

Вначале ты…

Вначале, ты решаешь поучить Python, начинаешь немного углубляться… … и приходишь в себя в тот момент, когда читаешь о фреймворках. Read more…