👑 Dharmzeey
Yes, the ProfileCreateView uses the default ProfileCreateForm that extends UserCreationForm, that will use the default django username and password for registration. Then on line 18, I am creating an instance of Profile class which is my custom model
👑 Dharmzeey
So when he ProfileCreateView is called, the custom model gets created automatically
👑 Dharmzeey
Do you understand
Kim
I think that's the problem, superuser isn't created by that form. When u run ./manager.py createsuperuser it doesn't run ProfileCreateView, so that way he can't create a profile for superuser because it is not executing ProfileCreateView
Kim
So I think u should use django signal instead
👑 Dharmzeey
I am not asking or want to find out, is there any other way I can do it without having to extend the AbstractUser or do anything with it
👑 Dharmzeey
So I think u should use django signal instead
Signals will work, even when I run createsuperuser??
👑 Dharmzeey
I'll read up on that and try it
Kim
Signals will work, even when I run createsuperuser??
I think signal will work when a new user instances is created
Kim
Here is the thing
Kim
U can create a profile model with 1-1 relationships with user
Ali Hasan
I think signal will work when a new user instances is created
Is it possible that he modifies the createsuperuser function and create a profile in addition to its job ?
Kim
Is it possible that he modifies the createsuperuser function and create a profile in addition to its job ?
I think superuser is a user instance, if u go to admin page u can see your super user account there in the user table
Ali Hasan
I think superuser is a user instance, if u go to admin page u can see your super user account there in the user table
Yeah I know that but I mean if it’s possible to just modify the createsuperuser then he won’t have to change or add models or anything
Ali Hasan
I’m a beginner tbh but just tried to give my opinion if it helps
Kim
U don't need a model to create a superuser, u can create a superuser by running python manage.py createsuperuser or using admin page creating a user with a admin privileges
Kim
I’m a beginner tbh but just tried to give my opinion if it helps
Please tell if is this what are u talking about, because my English is not so good, sorry if didn't understand
Ali Hasan
U don't need a model to create a superuser, u can create a superuser by running python manage.py createsuperuser or using admin page creating a user with a admin privileges
I didn’t know that creating super user from admin panel is same as creating it using command line as I’ve never went through that experiment , thanks for the info
Kim
So than u can create some users on admin page
Ali Hasan
U will need to create superuser by command line first to get access to admin page
Yeah definitely but all the projects I’ve practiced on didn’t use more than one super user that’s why I never tried creating one from the admin panel
Kim
On admin page u can give some privileges to some users
Kim
I'll read up on that and try it
Good luck, than u can tell us if it works
👑 Dharmzeey
Thanks so much Man Signals worked, tho I just reads small portion of django signals and I was able to solve the problem
👑 Dharmzeey
Thanks Kim And also @ahmaba97
Kim
👏🏾👏🏾👏🏾👏🏾😊
Doragonsureiyā
Rule 5️⃣: To share code or error tracebacks, use an online pasting service like: - https://dpaste.org - https://linkode.org - https://hastebin.com - https://bin.kv2.dev If you posted a wall of text, go back and delete it.
tank
How do i find django free admin penal code
HamidReza Fekri
hello how to implement question and answer model when choice order is important
Ali Hasan
If I understand correctly, each question has many answers but each answer has a different weight , for example answer A has a weight of 20 but answer B has a weight of 80 , is that your question ?
HamidReza Fekri
sequential choice
Ali Hasan
sequential choice
If each answer has a different weight, adding a field that shows its weight should be enough and you can order based on the value of that field
Ali Hasan
and other type that only one order choice is correct
I can’t understand your exact situation here but maybe giving that correct choice a weight of 100 and the rest to be 0 ?
HamidReza Fekri
we should sort choices that only special order is correct
Shrikrushna
Can anyone help me?
Doragonsureiyā
Can anyone help me?
Not until you explain your difficulties.
Maxim
Can anyone help me?
what kind of help do you need?
T2ABIZZ
hi I have a customer model that is based on user default model (one to one link) in the customer the is phone field when i try to sign up a new user in /auth/users/ i cant find the phone field how can i add it?
Sarah
Hi guys I need help...I want to create a field for student registration number to be Stud001 and it should increment once I add the second student it should auto generate Stud002
T2ABIZZ
You might have to modify the User model
u mean add the phone field to the user ?
👑 Dharmzeey
u mean add the phone field to the user ?
Yes, if you will require it on user sign-up
T2ABIZZ
and then delete it on the customer model?
Kim
hi I have a customer model that is based on user default model (one to one link) in the customer the is phone field when i try to sign up a new user in /auth/users/ i cant find the phone field how can i add it?
Try to create a form class that based on UserCreateForm, than into this class create an new attribute for phone number than on Meta class o can add that attribute on fields list
Shrikrushna
what kind of help do you need?
I am making a project of voting system. If I have a problem with it, can you help me?
Shrikrushna
ask specific questions here
There is a button. After clicking on the button, voting should take place
Doragonsureiyā
There is a button. After clicking on the button, voting should take place
Read this please: http://catb.org/~esr/faqs/smart-questions.html#intro
Maxim
There is a button. After clicking on the button, voting should take place
It's impossible to help based on this description you have to give us more details
Shrikrushna
It's impossible to help based on this description you have to give us more details
I have a voting system every day, but I have tried a lot, it is that clicking on the button should be done and it should be stored in the admin's class.
Maxim
I have a voting system every day, but I have tried a lot, it is that clicking on the button should be done and it should be stored in the admin's class.
you don't seem to understand i'm not talking about complaining about life, but about information that will help someone understand what is wrong with your code
Shrikrushna
Ya you can solve my problem
Shrikrushna
Plz
Karthik
Any one know LDAP and pythin-ldap library
Karthik
The libraries In my project not working properly
Doragonsureiyā
Any one know LDAP and pythin-ldap library
Don't ask meta questions like: "Any user of $x here?" "Anyone used technology $y?" "Hello, I need help on $z!" Just ask directly! The better you are at explaining the problem, the more likely you are to get help. Asking smart questions
Karthik
When I try to installed python-ldap library , the library was not installed ,
Karthik
Error is microsoft visual c++ is required
R V Bandgar
Can you please tell me how to convert Django project into .exe file?
Doragonsureiyā
Can you please tell me how to convert Django project into .exe file?
So, people, listen... if you're writing Python code but at the end you're coming to ask how to compile it, how to hide the code, how to make a single executable (make a .exe file 🙄), or things like those, it means you don't know what you're doing, because that's not how Python works, that's not the way you should run your Python scripts, if you wanna do those things then change your programming language. Yes, there are tools that make Python code to be one executable (compile it, convert to .exe, call it whatever you want) but, if you use them, it means you really know what you're doing and you won't be here asking how to achieve that task, otherwise just use other programming language. If you're using Python to write code, you should know how it works and how to run your scripts without bloating them with unnecessary stuff.
Karthik
LDAP.initalize() not showing that library
Maxim
I am not asking about python but Django..I know how to convert python to. exe..Before giving reply read question carefully..
Django doesn't work without Python, so the same goes for Django to the fullest extent (and even more)
👑 Dharmzeey
Plz
State your code and your problem, I mean the errors Not what the project is all about
Mihail
are any built-in functions in django to get in script (tests) url of object in admin panel?
Mihail
Just use reverse with admin as namespace
No any more ways? Like get _absolute_url()?
Mirco
No any more ways? Like get _absolute_url()?
You answered by yourself, you have the get absolute url to play with But anyway if you need to point to the detail view of object in admin, you need to use admin namespace and reverse
Youssef
Hi guys can programme a big projets by Flask only ?
Youssef
Is true Flask is simple and very fast than Django ?
agwayne
Use fastapi