Advanced search

DjangoDjango - Tutorial 052. Redefining a User Model

April 26, 2020, 2:08 p.m.

Python, QuerySet, django, Model

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

R
Nov. 23, 2019, 7:56 a.m.
RED_Spider

Qtаномалия корвентации QString в char* Linux

всем привет, есть библиотека которая является прослойкой между Qt библиотекой и питоном, она получает JSON и через калбек отправляет в питон

проблема в том что в некоторых случаях программа на Python падает, падает она через непонятную для меня аномалию, возможно кто-то может объяснить п…

EVILEGRelease EVILEG-CORE 0.0.5

Oct. 27, 2019, 3:55 a.m.

ECNF-C, Django, EVILEG, Releases, Python

Introducing the new release of EVILEG-CORE 0.0.5.

DjangoDjango - Tutorial 048. How to add online status to a site

Sept. 2, 2019, 6:31 a.m.

Auth, Django, Backend, Python

For a long time I did not add such functionality on the site for the simple reason that I did not know which side to approach this, because I would like to process this information in one single place, and not in every View.

Over time, I began to modify Backend classes for the site and the solution came by itself. It was only necessary to modify each authentication backend that is used on the site. And rewrite the get_user method, which will store information about the user's last request to the site. And the online status can be saved for the last 15 minutes, then the status will be offline.

And the date of the last request can be stored either in the user’s profile, which will be the OneToOne model for the user, or override the user model. I chose the option of overriding the user model.

DjangoDjango - Tutorial 044. How to Install and Configure Django on Mac OS

April 23, 2019, 3:10 a.m.

Mac, Homebrew, Nginx, MacOS, Python, Apple, Django

I propose to consider the process of installing and configuring a Django project on Mac OS X based on an existing project.

Some steps will be similar to those already performed in the Django setup article for Ubuntu .

MU
Feb. 13, 2019, 5:30 p.m.
Maciej Urmański

DjangoDjango change button status

Hi,

I search through internet and review many apps but still don't have answer maybe on this forum someone help me.

I try to create changing button after user join to Goal.

I have work buttons, but i don't know how to change this in template.

I try to do this with boole…

DjangoКак использовать Coverage в Django

Jan. 29, 2019, 1:53 a.m.

Django, Python

Когда вы разрабатываете большой проект, случайно можно забыть некоторые части кода, которые нужно протестировать. Coverage.py - это инструмент на python, который поможет вам в этом.

DjangoИспользование Jinja2 с Django (начиная с 1.8)

Jan. 28, 2019, 12:19 a.m.

Django, jinja, Python, template

На ресурсе Medium Corporation пользователь под ником Samu делится опытом использования Jinja2.
По его словам ранее он использовал Jinja2 в своих проектах, созданных с помощью Flask. Но затем решил использовать Jinja2 с Django для потенциального повышения производительности (в 10-20 раз быстрее по сравнению с шаблонами Django) и взаимодействия с Nunjucks.
Samu делится опытом с людьми, которые уже знакомы с данными технологиями, а его статья призвана немного раскрыть и упростить шаги.

DjangoDjango - Tutorial 039. Adding private messages and chats on the site - Part 2 (Dialogue and chat counter with unread messages)

Oct. 25, 2018, 1:47 a.m.

django, сообщение, Python, чат

Gave free time to correct private messages on the site. This functionality is not used very often, so I do not make great efforts to improve it, although it is time to bring this functionality to adequate work.

Previously, there was a very big flaw, which was that the dialogue counter with unread messages was not shown, which led to the fact that the users who were sent the message simply did not pay attention to it, because they did not know about it.

Now I finally fixed this flaw. And in the framework of the previous code I will show which corrections were added.

DjangoDjango - Tutorial 038. Use BeatifulSoup 4 to clean up the published content from unwanted html tags

Oct. 24, 2018, 1:38 a.m.

BeaftifulSoup4, Django, Python, HTML, Python 3

When developing a web site that adds the ability to write comments or publish articles that allow html layout, the mechanism for clearing unwanted html tags, in particular script and style tags, is important, since malicious scripts on a quality resource definitely should not be present. It will also be good to be able to clean up the style of the text, especially if the resource implies a uniform style. The discordance of screaming fonts is not needed by anyone, and adds problems with the layout.

To implement this mechanism, I use the Python package Beautiful Soup 4 and finally wrote one class, which essentially does everything I need. Removes unnecessary tags, adds necessary classes to tags, saves classes in tags, if you need to leave them during stripping, this is important for classes that are added at the stage of writing a comment, for example, when inserting a YouTube video or adding program code when the user selects which programming language should be represented in the program code block.

How to become an author?

Contribute to the evolution of the EVILEG community.

Learn how to become a site author.

Learn it
Donate

Good day, Dear Users!!!

I am Evgenii Legotckoi, developer of EVILEG. And it is my hobby project, which helps to learn programming another programmers and developers

If the site helped you, and you want also support the development of the site, than you can donate by following ways

PayPalYandex.Money
Timeweb

Let me recommend you the excellent hosting on which EVILEG is located.

For many years, Timeweb has been proving his stability.

For projects on Django I recommend VDS hosting

View Hosting Timeweb
s
June 3, 2020, 1:56 a.m.
silo1995

C++ - Тест 003. Условия и циклы

  • Result:35points,
  • Rating points-10
AP
June 2, 2020, 9:11 p.m.
Aleksej Pikenin

C++ - Test 005. Structures and Classes

  • Result:75points,
  • Rating points2
June 2, 2020, 1:04 p.m.
Daniil Chizhevskij

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

  • Result:86points,
  • Rating points6
Last comments
June 3, 2020, 2:50 p.m.
Mihailll

Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

И использовали QWebEngineView как виджет? Попробуйте setUrl(const QUrl &url)
s
June 3, 2020, 2:33 p.m.
safevgeniia

Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

я с учетом обновлений использовала webenginewidgets
s
June 3, 2020, 2:32 p.m.
safevgeniia

Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

я с учетом обновлений использовала webenginewidgets
June 3, 2020, 2:25 p.m.
Mihailll

Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

Если взяли все из примера, то не должно собраться, т.к. webkit webkitwidgets уже не работают. Какой класс Вы используете для браузера?
s
June 3, 2020, 2 p.m.
safevgeniia

Qt/C++ - Lesson 036. QWebView – How to make simple browser on the Qt

Вроде вск записала правильно, все подключила . Проблем со сборко нет. НО вместо сайта выводится белый экран просто. В чем проблема может быть? По задумке, при нажатии на кнопку долже…
Now discuss on the forum
June 3, 2020, 2:34 a.m.
Evgenij Legotskoj

Qt- C++ QTableView подсветить строку

Некогда было
f
June 3, 2020, 1:49 a.m.
fryn3

Можно ли сделать в QML таблицу как в Excel?

edi-tableview - нашел пока такое выглядит коряво, посмотрим что можно сделать
June 2, 2020, 2:46 a.m.
Evgenij Legotskoj

Медиа файлы Google Firebase

Картинки можете попробовать сжимать через QPixmap, там есть возможность установки scaleFactor, через него можете устанавливать нужные параметры. А что касается конвертации видео, то лучше п…
June 2, 2020, 2:01 a.m.
Evgenij Legotskoj

Перехват обращения к локальным файлам QWebEngineView

В вашем случае вполне адекватное решение. Так сказать меньше зло. В противном случае пришлось бы очень много переписывать и перепиливать.
a
June 1, 2020, 10:26 a.m.
alekseyttrv

SSL на Android

у меня стоит версия Qt 5.14.2. В настройках android поставил openssl из коробки, и этот прроект автоматически стянулся. Достаточно было только добавить в .pro-файл строку после этого и все …
About
Services
© EVILEG 2015-2020
Recommend hosting TIMEWEB