Add user account failure

I am trying to add user in the admin panel of my blogging app. But if I enter the credentials (username and password) and click save, instead of redirecting me to the ‘user change’ page, it only clears the passwords and nothing is saved.

1 Like

Please provide more details about the environment and your project.

Is this in a production deployment environment or in your developent environment?

If this is happening in development, check the console where you’re running runserver - look for the POST request for the form submission.

If this is happening in production, check your server logs for errors.

Are you using a custom user model? Custom admin form(s)? Custom authentication? Custom password validators? If so, please post all custom code here.

1 Like

I have resolved the problem. There were missing fields in the custom user model.

Thanks.

That’s a solid catch on the settings. Sometimes these account creation failures are just down to a tiny mismatch in the environment variables or the database router if you’re using a custom one. I’ve found that using a dedicated management utility to double-check the user data before the save method hits can save a lot of debugging time.