M
Oh let me check it more . thanks
Pradyum
How to add users in group?
Pradyum
I have created a group and given appropriate permissions to i
Pradyum
but am not able to add users to that group
Pradyum
Example
>>> admin
<Group: group_admin>
Now adding user to the group example text
>>> admin.user.add(test)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'Group' object has no attribute 'user'
Sadra
Pradyum
Pradyum
Yes, have inherited AbstractBaseUser and BaseUserManager I asked because issue persist
Pradyum
>>> mygroup
<Group: group_admin>
>>> User.objects.filter(id=user_id).get()
<User: agency@user.com>
>>> my_user = User.objects.filter(id=user_id).get()
>>> mygroup.user_set.add(my_user)
Traceback (most recent call last):
File "<console>", line 1, in <module>
AttributeError: 'Group' object has no attribute 'user_set'
Sadra
hold on.
Sadra
Did you create a new Group inherited from django.contrib.auth.models.Group or it's the exact model?
Pradyum
yes absolutely
Pradyum
and even am also able yo list down all the groups and their respective permissions Group.objects.all()
Pradyum
to*
Anonymous
Can anyone help me that how can i get job .i am fresher and i know python, django,css,html MySQL
Pradyum
Mirco
Sadra
Pradyum
Okay no issues, Thank you for taking out time on this :)
Sadra
Pradyum
and then makemigrations add the groups for the custom user model
Pradyum
That was the reason it was not working makemigrations gave this result> - Add field groups to user
- Add field user_permissions to user
Sadra
R.U.S.H.A.B.H
Typeerror :-
'ManyRelatedManager' object is not iterable
Error coming while printing the many to many field in html template
Maxim
Anonymous
Do any one have hands on how to use docker in windows 10 home using virtual box
Mirco
R.U.S.H.A.B.H
R.U.S.H.A.B.H
😌
Anonymous
Is it possible to add a widget or any option on admin for ImageField so that if the image already exists in my S3 bucket we just put the URL for the same.
Do I have to change something in models or have to override save method?
If anyone knows a approach please help.
Sadra
Sai
Darth✧
I m facing some difficulty while connecting ec2 and pycharm as remote host for my django project ....can anyone help ?
Sunder
I am unable to start the server in windows 7.
Sadra
You can make a condition in the save method and check if any object with the same value is existing. If the condition turns True, you need to raise a proper exception.
Anonymous
Hello, how do you document you Django rest framework(DRF) APIs, using swagger or something else, I am just exploring a solution which requires the least effort, postman is good but its has its limitations mostly related to pricing
Anonymous
Rockefeller
Hey guys!!
Shyamkumar
how share code !
Hello
Wannabe
tricky_Velvet
please share your code dum dum
tricky_Velvet
Dude use a service ..
Sai
Can i see your code
Armin
She/He means use a code sharing service like bitbucket and share the link
Rids
I need to make a chatting app in Django..where should I learn
Rids
Someone please help
Rids
I don't know about django channels
Rids
What is it
Rids
Can you tell me more
Sadra
Creating an isolated environment which transfers all packets and data asynchronously.
Google knows better. :) ❤️
Rids
What are web sockets
Rids
Ok thank you so much
Sadra
Sunder
I am new and just started learning
Sunder
Python is not recognize as an internal or external command
os- windows 7(32 bit)
path of python- C:\Users\pc\AppData\Local\Programs\Python\Python38-32
C:\Users\pc\AppData\Local\Programs\Python\Python38-32
C:\Users\pc\AppData\Local\Programs\Python\Python38-32>python -m django --version
3.1.2
C:\Users\pc\AppData\Local\Programs\Python\Python38-32>python --version
Python 3.8.6
in VS terminal
C:\Users\pc\Desktop\VSC\hello>python manage.py runserver
'python' is not recognized as an internal or external command,
operable program or batch file.
Sai
Mapesa 🗽
Just want to know which is better kivy or django ???
Sunder
Sunder
After installing python,👆is the path
Chyngyz
Hey everyone. Do you know how to add fields to model based on Boolean field?
For example, i need to add fieldA if status=True, else add fieldB
Mapesa 🗽
Omair
Omair
Or if you are using Postgresql as the database you could use a json field to store a key value pair depending on the boolean
Chyngyz
DTN
Hi. I have made a django modelform that i pass to my ModelAdmin but it renders like in the second picture. How can I get my fields to get render like in the first picture?
https://imgur.com/a/E4KYZkS
Ayomide
i have an issue with handling staticfiles in production server....
the staticfiles arent coming through with nginx and gunicorn
Ayomide
any suggestions please ?
Sadra