Skip to content

Tag: django

Django queryset to list of ids with integer values

I need to retrieve IDs from multiple queries and add them into a list. Then I tried This raised error as list cannot be added to queryset. so, I tried, This works but, all_products has a mix of int and tuple values [10, 20, 30, (2,), (2,), (1,)] I need them to be [10, 20, 30, 2, 2, 1] Answer

Can’t create superuser in Django using custom user

I got this error when i try to run manage.py createsuperuser TypeError: UserManager.create_superuser() missing 1 required positional argument: ‘username’ My User model: and in my settings.py file: How can i solve this? Im new in Django, documentation is confused to me… I already tried remove…