Skip to content
Advertisement

Tag: django

How to get request params in Django admin custom column?

I need to keep information about filtering and searching in Django admin change page. So when user filters by “?away_team__id__exact=267821”, I need to append this query to change page url. Let’s say we filtered objects by query above. This is the url of change list: I want to make change column which redirects user to change page of the current

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 freeze” list if it he Here

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 : models.py signup view in views.py the

Trouble getting started with Django Channels

I am creating my own application inspired from the Channels 2.0 tutorial. However, I am unable to establish WebSocket connection. Daphne complains for 404 saying the websocket URL can not be found. I am not sure where the error is. UPDATE: My Daphne is running behind an nginx server. The nginx config is updated as well: My directory structure is

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

Advertisement