Evgenii Legotckoi
Evgenii LegotckoiSept. 11, 2023, 4:47 p.m.

DjangoDjango - Protected media content

nginx, protected, Django

On one of the resources that I am developing, there was a need to add protected access to media content, checking the user's right to access this media content. Simply put, can the user view the photo that nginx serves …

Read
Evgenii Legotckoi
Evgenii LegotckoiAug. 20, 2023, 9:51 a.m.

DjangoChoosing a Canonical URL

django, MVP, URL, Google Search Console

I started working on one small Django project and after creating a Minimum Viable Product , I launched it immediately into the online space so that it would start to be indexed by search engines.

Thus, I expect that at …

Read
IscanderChe
IscanderCheAug. 9, 2023, 5:39 a.m.

QtQScintilla C++ example

Qt

Unfortunately, I completely erased from my memory how I received the distribution kit (it was three years ago, and then I did not return to this topic). Here you have to thoroughly scour the Internet. You can try this resource: …

Read
Evgenii Legotckoi
Evgenii LegotckoiMay 16, 2023, 3:52 p.m.

DjangoDjango - Lesson 064. How to write a Python Markdown extension

Python, markdown, MarkdownField, Django

On this site and a couple of other projects, I actively use markdown to write text, and then generate html code from it. And in the end, I wrote a couple of extensions that perform some specific functionality, which somewhat …

Read
Evgenii Legotckoi
Evgenii LegotckoiMarch 31, 2023, 6:32 a.m.

DjangoDjango - Lesson 063. Full text site search for multiple models with multilingual support

Django, python, Django 3, modeltranslation, full-text search, Django 4

Finally, I managed to make a fairly fast full-text search across several models, taking into account the optimization of requests on the site, which would suit me and meet my requirements for the quality of the project.

If you now …

Read
Evgenii Legotckoi
Evgenii LegotckoiMarch 20, 2023, 6:17 p.m.

DjangoDjango - Lesson 062. How to write a block-template tabbar tag like the blocktranslate tag

tag, templatetags, Django, Django 3, Django 4, template

In this article, I'll show you exactly how you can write a simple block template tag, like the blocktranslate tag in Django .

These block template tags have an opening tag and a closing tag, and the most common one …

Read
Evgenii Legotckoi
Evgenii LegotckoiMarch 19, 2023, 10:56 a.m.

DjangoDjango - Tutorial 061. Adding a Unique View Count

Django, Counter, Django 3, python, Django 4

At the very beginning of creating articles and questions on the forum, I added a simple counter of views on this content.
This counter was an ordinary field of integer type and each time a page was requested it was …

Read
Evgenii Legotckoi
Evgenii LegotckoiMarch 18, 2023, 4:09 p.m.

DjangoDjango - Lesson 060. Speeding up a website with caching templates

Django 3, model_cached_property, cache, Django 4, invalidate, Django

One of the ways to significantly speed up the speed of a Django site is to cache both individual parts of the site templates and cache the templates after they are compiled by the site. Therefore, we will study both …

Read
Дмитрий
ДмитрийDec. 10, 2022, 1:50 p.m.

QtHow to open image with correct orientation with Qt tools

QImageReader, поворот изображения при загрузке, QImageWriter, поворот изображения, метаданные jpg

Some popular image formats (like jpg) may contain metadata. One of them is rotation. If you create the file in a graphics editor, then rotate it in the viewer, and finally load it into your application using the QImage, QPicture, …

Read
Evgenii Legotckoi
Evgenii LegotckoiOct. 16, 2022, 3:58 p.m.

Djangodjango_model_cached_property - Caching property for individual model objects in Django

cache, model_cached_property, invalidate, redis, Python 3, Django

Introducing the release of the stable battery django_model_cached_property for caching property for individual model objects in Django.

I already said that evileg_core contains similar functionality, but now I decided to bring this caching into a separate package. This is due …

Read
Дмитрий
ДмитрийSept. 7, 2022, 2:40 p.m.

C++Engineering solution of a cubic equation using Vieta's trigonometric formula

кубическое уравнение, unique_ptr, компьютерная математика, полиномиальное уравнение, тригонометрическая формула Виета

As you know, the solution of the cubic equation has been known since the 16th century. However, even today, engineers can face a problem in solving it. This complexity is due to the need to extract the root from complex …

Read
Evgenii Legotckoi
Evgenii LegotckoiSept. 5, 2022, 3:45 a.m.

DjangoAnalysis of errors in the development and promotion of a site on Django - Custom tag<cut>

development, Django, Custom

And now some thoughts on the topic of custom tags, and whether they should be introduced at all.

The short answer is NO.

Now let's think about this topic - "Why?" . There is such a well-known Russian-language resource Habr, …

Read
ОН

C++ - Test 006. Enumerations

  • Result:10points,
  • Rating points-10
K
  • KiRi4
  • Sept. 7, 2023, 7:57 a.m.

C++ - Test 002. Constants

  • Result:41points,
  • Rating points-8
K
  • KiRi4
  • Sept. 7, 2023, 7:49 a.m.

C++ - Test 001. The first program and data types

  • Result:66points,
  • Rating points-1
Last comments
IscanderChe
IscanderCheSept. 13, 2023, 9:11 a.m.
QScintilla C++ example По горячим следам (с другого форума вопрос задали, пришлось в памяти освежить всё) решил дополнить. Качаем исходники с https://riverbankcomputing.com/software/qscintilla/downlo…
Evgenii Legotckoi
Evgenii LegotckoiSept. 6, 2023, 7:18 a.m.
Qt/C++ - Lesson 048. QThread — How to work with threads using moveToThread Разве могут взаимодействовать объекты из разных нитей как-то, кроме как через сигнал-слоты?" Могут. Выполняя оператор new , Вы выделяете под объект память в куче (heap), …
AC
Andrei CherniaevSept. 5, 2023, 3:37 a.m.
Qt/C++ - Lesson 048. QThread — How to work with threads using moveToThread Я поясню свой вопрос. Выше я писал "Почему же в методе MainWindow::on_write_1_clicked() Можно обращаться к методам exampleObject_1? Разве могут взаимодействовать объекты из разных…
n
nvnAug. 31, 2023, 9:47 a.m.
QML - Lesson 004. Signals and Slots in Qt QML Здравствуйте! Прекрасный сайт, отличные статьи. Не хватает только готовых проектов для скачивания. Многих комментариев типа appCore != AppCore просто бы не было )))
NSProject
NSProjectAug. 24, 2023, 1:40 p.m.
Django - Tutorial 023. Like Dislike system using GenericForeignKey Ваша ошибка связана с gettext from django.utils.translation import gettext_lazy as _ Поле должно выглядеть так vote = models.SmallIntegerField(verbose_name=_("Голос"), choices=VOTES) …
Now discuss on the forum
IscanderChe
IscanderCheSept. 17, 2023, 9:24 a.m.
Интернационализация строк в QMessageBox Странная картина... Сделал минимально работающий пример - всё работает. Попробую на другой операционке. Может, дело в этом.
NSProject
NSProjectSept. 17, 2023, 8:49 a.m.
Помогите добавить Ajax в проект В принципе ничего сложного с отправкой на сервер нет. Всё что ты хочешь отобразить на странице передаётся в шаблон и рендерится. Ты просто создаёшь файл forms.py в нём описываешь свою форму и в …
BlinCT
BlinCTSept. 15, 2023, 12:35 p.m.
Размеры полей в TreeView Всем привет. Пытаюсь сделать дерево вот такого вида Пытаюсь организовать делегат для каждой строки в дереве. ТО есть отступ какого то размера и если при открытии есть под…
IscanderChe
IscanderCheSept. 8, 2023, 12:07 p.m.
Кастомная QAbstractListModel и цвет фона, цвет текста и шрифт Похоже надо не абстрактный , а "реальный" типа QSqlTableModel Да, но не совсем. Решилось с помощью стайлшитов и setFont. Спасибо за отлик!
Evgenii Legotckoi
Evgenii LegotckoiSept. 6, 2023, 6:35 a.m.
Вопрос: Нужно ли в деструкторе удалять динамически созданные QT-объекты. Напр: Зависит от того, как эти объекты были созданы. Если вы передаёте указатель на parent объект, то не нужно, Ядро Qt само разрулит удаление, если нет, то нужно удалять вручную, иначе будет ут…

Follow us in social networks