Skip to content

Tag: django

Django TypeError: id() takes exactly one argument (0 given)

So I have been trying to implement a way to upload multiple images to a post. The way I did it is to have tables. One for the actual post, and one of the multiple images uploaded. I was planning to link them with a foreign key but it is not working. My terminal started throwing the error “TypeError: id(…

Static Files from Site working, but not from app

Some confusion about static files (Python 3.6 Django 2.. IIS 8.5) My static files from site are found but the static files from the app are not found. I tried to add to the settings.py but did not help. Do I have to add a web.config also in the app static like in the site static folder? For IIS configuration

Protocol error, got “H” as reply type byte

I am trying to use django channels for the first time and i am following the tutorial in the documentation. But when I use python manage.py runserver and try to connect i get this error. Here is the whole console(I’m using anaconda): On the frontend js return this error Here is the whole “pip free…

Removing case sensitivity from Email in Django login form

I’ve created a custom UserModel and used Email as main authenticating id instead of username. The problem that it is case sensitive, as it counts test@gmail.com,Test@gmail.com as 2 different accounts. I need to force it to deal with both as 1 account ignoring if it upper or lower case. Here are my files…

Concatenating into a new field in a Django query

Consider a table called DataTable. It has two fields, A and B. I want to return all rows of this table plus annotate a field called C that is a concatenation of A and B. Here is what I have tried problem here is that C is literally just the string literal “A – B” for every returned row. I