Django Mails

8 views
Skip to first unread message

mick

unread,
Mar 23, 2020, 2:50:29 AM3/23/20
to Django users
I want the admin and the user themselves both to verify the mail on the user registration.And then only the user is being validated.

Juan J. Moreno Piña

unread,
Mar 23, 2020, 5:23:29 AM3/23/20
to django...@googlegroups.com
Hello there,
When we accept user input we need to check that it is valid. This checks to see that it is the sort of data we were expecting.
There are two different ways we can check whether data is valid. (see : http://www.easypythondocs.com/validation.html)
You can use a flag, e,g:
flagName = False
while not flagName:
    if [Do check here]:
        flagName = True
    else:
        print('error message')
or
could use an exception, e.g.
while True:
    try:
        [run code that might fail here]
        break
    except:
        print('This is the error message if the code fails')

print('run the code from here if code is successfully run in the try block of code above')
hope this could help.

Teaching to learn
Trading to survive
*M.Sc. Juan J. Moreno*
En Venezuela (Maracaibo)
Skype:studiom2j
Tel (Italy): +39 02320628565






El lun., 23 de mar. de 2020 a la(s) 02:51, mick (dhruvash...@gmail.com) escribió:
I want the admin and the user themselves both to verify the mail on the user registration.And then only the user is being validated.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/a1363076-8bec-41cc-8f11-dfed41cd9a24%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages