GenericView: Attributeerror ‘list’ object has no attribute ‘filter’ // 1-second guide 😮💢

So you are casually overriding get_queryset() in a, say, ListView, like this:

def get_queryset(self):
    entries = [x for x in Entry.objects.all() if x.publications]
    return entries

Because you need to sort the Entry table by a reverse M2M relation publications and then BAM!:

Attribute error 'list' object has no attribute 'filter'

Without a trace of the line you made a mistake in…

Read More »

Port is already in use // 1 second guide 🐝

Pycharm in particular likes fetching Django console spontaneously (while I’m copy-and-pasting things in project tree). After runserver:

Performing system checks...

System check identified no issues (0 silenced).
July 09, 2019 - 15:45:49
Django version 2.0, using settings 'project.settings'
Starting development server at
Quit the server with CONTROL-C.
Error: That port is already in use.
Read More »