Closed MidnightStallion closed 1 month ago
Hi @MidnightStallion, there is a simple_host
parameter for the url
function.
$ python -c "from validators import url; print(url('https://localhost', simple_host=True))"
True
I guess an example in the documentation might help.
ref https://github.com/python-validators/validators/issues/285#issuecomment-1676336214
Hi yozachar. Thanks for your fast response and sorry for the trouble. It works the way I intend when I use simple_host. Thanks for all your work on this. It has saved me a lot of time when it comes to validation.
To the best of my knowledge, a URL such as 'http://localhost' should be valid. but validators says it is not.
http://127.0.0.1 works, but http://locahost does not.
If my understanding is correct, a local host running web server does not need an FQDN for it to work. So I believe 'http://localhost' or 'http://localhost:8000' should be a valid URL.
Steps to reproduce: