
Django → Django - Tutorial 058. Database Growth Due to django_session Table
Django, Postgres, garbage collection, Python, PostgreSQL
Lately, I have noticed that the fatal moment is approaching, when the disk space for the site on the hosting will catastrophically cease to be enough. And the database dump becomes incredibly huge, although there are no obvious prerequisites for this. The content size of the site isn't growing that fast, and the number of registered users isn't growing that fast either.
After examining the database, it was found that the size of the django_session table is just a gigantic almost 7 GB, and the size of the index also reaches almost 6.5 GB, despite the fact that the size of the database itself is 14 GB.
At the same time, the size of the second largest table is only 11 MB and this is a third-party application with a list of cities. And the size of the third table, which contains messages on the forum, is only 8 MB.
Accordingly, it was decided to figure out why this is happening and how to fix it.
Right now, I probably won’t reveal anything new to those who actively administer PostgreSQL databases, but for beginners and those who mainly deal with Django as a PET project, without professional use, the information may be useful.

Django → Django - Tutorial 056. How to convert image to WEBP format when saving to ImageField
ImageField, Django, WEBPField, webp, Python
WEBP is an image compression format that was introduced by Google in 2010. Its main advantage is its low size without visible loss of quality compared to formats such as JPEG or PNG. Therefore, it is quite logical to use this format for storing images on the site, especially if you do not need to store the original images on the site.
After a long search, I still did not find a ready-made and simple solution that would support converting images to WEBP format on the fly.
Therefore, I decided to write my own version, which eventually consists of a couple of dozen lines and is as simple as a wooden board.

Django → Django - Tutorial 055. How to write auto populate field functionality
field, Django, python, auto, Python
For a long time I wanted to write an article on how to write auto populate field functionality for a Django project. This is a very useful feature that allows you to change the content of other model fields in Django by setting a value to a field that uses auto populate.
First, why is it needed? - Such functionality allows you to reduce the size of the code in those places where you need to rewrite other fields of the object when they change. That is, for example, you do not have to redefine the save method each time in order to rewrite some field in case other fields of the object change. Also, using auto populate is basically a more advanced and neat way to manage data models in Django.
And also a similar approach can solve some problems and improve the site.
Qt → Qt C++ и Python
Может быть Qt тут и ни при чём, тогда как это сделать в C++.
C++ учу. Python - ну слышал что такое есть, умею писать print("hello world").
Имеется огромное желание решить одну задачу.
Допустим, имеем библиотеку nltk в python и некую программу на C++.
nltk выдаёт такое:
…
Python 3 → Python 10 line toast notifications
Введение
Мы часто используем print что-бы проследить за состоянием скрипта, или когда занимаемся отладкой. Вместо того, что-бы постоянно смотреть в окно терминала и ждать какой-то вывод, мы можем исползовать всплывающие уведомления как способ для просмотра вывода и параллельно с этим заниматься чем-то еще.
Сделать это совсем не сложно — мы будем использовать встроенные комманды нашей операционной системы для вывода уведомлений, просто запуская их через Python. Несколько строчек кода, и никаких сторонних модулей.

Python 3 → Python 10 line toast notifications
Введение
Мы часто используем print что-бы проследить за состоянием скрипта, или когда занимаемся отладкой. Вместо того, что-бы постоянно смотреть в окно терминала и ждать какой-то вывод, мы можем исползовать всплывающие уведомления как способ для просмотра вывода и параллельно с этим заниматься чем-то еще.
Сделать это совсем не сложно — мы будем использовать встроенные комманды нашей операционной системы для вывода уведомлений, просто запуская их через Python. Несколько строчек кода, и никаких сторонних модулей.

Qt → Qt for Python 5.15.0 has been released!
Компания Qt рада объявить о выходе Qt для Python 5.15.0! 🎊🐍
Вы можете получить последнюю версию с помощью: pip install pyside2 или просто обновив текущую установку: pip install -U pyside2.
В то же время разработчики Qt хотели выпустить еще одну версию для пользователей, которые все еще используют 5.14, поэтому решили выпустить 5.14.2.2. Вы также можете получить его через pip install pyside2==5.14.2.2.

Django → Django - Tutorial 052. Redefining a User Model
Model, QuerySet, Python, django
There are various options for working with a user model for creating a user profile and adding some specific information, for example, a profile photo. One way is to add a profile model with the OneToOneField field for the user. This option is simpler than a proxy model or overriding a user model. But for me personally, redefinition of the user model turned out to be more effective in terms of organizing code and writing various methods that allow you to extract the necessary information from the user object in templates without resorting to writing template tags.
Therefore, let's consider exactly the option of redefining the user model in a project in Django
Qt → аномалия корвентации QString в char* Linux
всем привет, есть библиотека которая является прослойкой между Qt библиотекой и питоном, она получает JSON и через калбек отправляет в питон
проблема в том что в некоторых случаях программа на Python падает, падает она через непонятную для меня аномалию, возможно кто-то может объяснить п…

EVILEG → Release EVILEG-CORE 0.0.5
Django, Releases, Python, EVILEG, ECNF-C
Introducing the new release of EVILEG-CORE 0.0.5.
Fornex
Let me recommend you a great European Fornex hosting.
Fornex has proven itself to be a stable host over the years.
For Django projects I recommend VPS hosting
Following the link you will receive a 5% discount on shared hosting services, dedicated servers, VPS and VPN
View HostingShare on social networks
Donate
The EVILEG project has switched to a non-commercial basis and will develop solely on the enthusiasm of the site creator, the enthusiasm of users, donations and the hosting referral system
Thank you for your support
Available ways to support the project
PayPal
PatreonYandex.MoneyMore