How to check request.form.get value null or not in python flask? -


i'm starting simple curd operation python flask framework , want when user submit form how check users selected value null or not?

i tried this

if request.method == 'post':         name = request.form.get('name')         city = request.form.get('city')         if name == '' , city == '':             print('its null')         else:              print('success') 

but when i'm submit without fill value give output

success 

i'm try none , null can't work.


Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -