Advanced search
Evgenij LegotskojAug. 26, 2019, 3:51 a.m.

DjangoDjango - Tutorial 047. How to do select_related and prefetch_related for an authenticated user

Backend, Model, Django, user

Imagine that for an authenticated user, when opening pages, some requests are constantly being executed, for example, an additional list of notifications is loaded, as well as his profile. And we use this information in templates, for example this way.

{% if user.is_authenticated %}
    {{ user.profile.avatar }}
    {{ user.notices.count }}
{% endif %}
ArrowAug. 2, 2019, 7:06 a.m.

DjangoДеплой Telegram бота на Django с исползованием webhook

Bot, Django, Telegram

Добрый день.

Помогите пожалуйста никак не могу найти информации о деплое Telegram бота на pythonenywhere.

Написал бота используя pyTelegramBotAPI (база данных, админка и еще некоторые вещи на Django). Столкнулся с проблемой, что на локальной машине с использованием polling() все ра…

Evgenij LegotskojApril 28, 2019, 9:36 a.m.

DjangoDjango - Tutorial 046. Reset migrations in the project

Model, Reset, Django

In the process of developing a project on Django, we may encounter an unpleasant situation when some packages and modules were removed and, accordingly, models from these packages were no longer used. But at the same time, squash of application migrations does not allow removing these packages, since migrations have many circular dependencies. As a result, removing unnecessary packages becomes a rather difficult task. Since resolving such dependencies becomes a non-trivial task. For me, such an unpleasant package was Django CKEditor, which was present almost everywhere. As a result, this package due to migrations remained for quite a long time in the list of requirements.txt, although in fact it was not used on the site at all.

Evgenij LegotskojApril 24, 2019, 3:42 a.m.

DjangoDjango - Tutorial 045. How to move model from one application to another

Application, Model, Django

I would like to share one of the possible way for moving the data model from one application to another.

Immediately, I note that this version of the data model transfer is not 100% working and you may need additional manual editing of the tables to correctly set the Content Type. Since any such modifications are fraught with data loss for GenericForeignKey relationships.

In my case, GenericForeignKey was not used, so there was no such problem.

Evgenij LegotskojApril 23, 2019, 4:10 a.m.

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

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

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
Maciej UrmańskiMarch 10, 2019, 1:01 p.m.

DjangoDjango list of subscribed objects

django, Django, python

Hi, I try to show user object from category which they subscribe. But don't know exacly how.

I have four models:
Board ( category )
Subject
Embed and Subscribe (foreign to user and to board)

class Board(models.Model):
    title = models.CharField(max_length=255, verbose…
MU
Maciej UrmańskiMarch 7, 2019, 5:01 a.m.

DjangoDjango rest framework and foreignkey

django, Django, python

Hi,

I try to save foreign key in django restframework serializer.

My goal is to save in database information from iframely.com and this part works good. But I need to also save it in specific category. After add field "Board(my category name field)" I have error: null value in colu…

MU
Maciej UrmańskiFeb. 20, 2019, 9:11 a.m.

DjangoUser attendance in app

django, python, Django

Hi, i try to create list of users attendance in goal app.

But i don't know how to filter user.

I have Goal model:

class Goal(models.Model, Activity):
    title = models.CharField(max_length=255, verbose_name='Tytuł')
    image = ImageField(blank=True, verbose_name='Tło')
    bod…
MU
Maciej UrmańskiFeb. 13, 2019, 6:30 p.m.

DjangoDjango change button status

django, Django, Python

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…

ArrowFeb. 8, 2019, 6:51 a.m.

DjangoЗапрос подтверждения удаления записи

href, modal, Js, Django

Добрый день!

Пытаюсь на django реализовать удаление записи, а диалог подтверждение удаления хочу вынести в модальное окно.

Файл views.py:

class DeleteObject(LoginRequiredMixin, DeleteView):
    model = Object
    template_name = 'todoList/home.html'

    def get(self, request, *…
Card image cap
Pulsum Via

Project for travelers from EVILEG.

Go
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 Hosting
Share 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

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

  • Result:80points,
  • Rating points4

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

  • Result:66points,
  • Rating points-1
GR

C ++ - Test 004. Pointers, Arrays and Loops

  • Result:90points,
  • Rating points8
Last comments

Qt/C++ - Lesson 061. Adding images to the application using the Drag And Drop method from the file manager

Доброго времени суток. А если нужно и изображение и текст? Что-то потерялся немного.... // Вместо отрисовки иконки и текста будем отрисовывать только одно изображение // с н…
AS

Qt/C++ - Lesson 004. QSqlTableModel – How to present the table from database?

error insert into TableExample " Количество параметров не совпадает" Я путь свой прописывала и даже бд удаляла, чтобы заново сделать, не работает. (всё остальное как у вас... Вроде ка…
i

Qt/C++ - Lesson 042. PopUp notification in the Gnome style using Qt

cialis powder comprare cialis online
LD

GameDev on Qt - Tutorial 1. Track mouse movement in QGraphicsScene

Вполне возможно, что ты не закинул graphicsView в дизайнере в виджет
LD

GameDev on Qt - Tutorial 1. Track mouse movement in QGraphicsScene

Кому интересно, поворот в slotTarget можно в одну строку организовать this->setRotation(90 + rotation() + qRadiansToDegrees(qAtan2(mapFromScene(point).y(), mapFromScene(point).x())));
Now discuss on the forum
M

Sorting the added QML elements in the ListModel

legal online pharmacy
  • Nomad
  • July 30, 2022, 5:42 a.m.

Как работать с HTMX?

Приветствую колеги. На днях наткнулся на вот это : https://htmx.org/ На офф сайте написанно вот такая фраза: htmx gives you access to AJAX, CSS Transitions, We…
h
  • harisr
  • July 25, 2022, 2:56 a.m.

QT - Native App Integration

Привет, у нас уже есть собственное приложение для Android. Можем ли мы интегрировать пользовательское представление QT в приложение со всем приложением QT внутри представления. Если да, ука…

Правильный запуск сервера на vps - Django

О я как то себе дома локальный сервер создавал. Вам же нужно просто сделать ручками конфигурацию системы. Настроить Nginx ну либо Apache (тут кому что нравится). Соответственно БД и всё остально…
o

Распознание объектов

Я к тому, что, возможно, софт уже есть.
About
Services
© EVILEG 2015-2022
Recommend hosting TIMEWEB