1👍
✅
You can save user with is_active
flag false, and then when you decide activate that user (is_active
to True). Users with is_active=False
can’t log in but appear for you in admin panel.
user = User.objects.create_user(
username=form.cleaned_data['username'],
password=form.cleaned_data['password1'],
email=form.cleaned_data['email'],
)
user.is_active = False
user.save()
Source:stackexchange.com