1

I am creating my own form to register users, but how can I make possible to create superusers in it, and also I know django allows you, call user in the views like this:reques.user.username. I can only use that using django forms or I can also use that with my forms

I creating my own form because I don´t want the restriccion django password have, is there a way to change that, in oder to not create my own form

2
  • python manage.py createsuperuser you can run command and other way is that while saving User data make is_superuser = True. Commented May 2, 2018 at 13:34
  • okay thank you, Also you know a way to change the restriccions of django user form password, because i whant the password to accept numers or letters, but not a mix of that and the passsword leght can be of six characters not of 8 characters, Commented May 2, 2018 at 13:42

1 Answer 1

1

You can run command

python manage.py createsuperuser 

Other way is that while saving User data make

is_superuser = True

For password

you need to inherit from AbstractBaseUser and then override that password field and needed to update it's hash, don't know how you will manage that thing but different hash are available.

Docs for custom user

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.