Для тех, у кого не установлен pip, я нашел этот быстрый скрипт на github (работает с Python 2.7.13):
import pkg_resources
distros = pkg_resources.AvailableDistributions()
for key in distros:
print distros[key]
Basic HTTP authentication:
http://coderseye.com/2007/how-to-do-http-basic-auth-in-ajax.html
jQuery поддерживает HTTP-аутентификацию с помощью метода ajax (). Примерно так должно работать:
jQuery.ajax({
type: "GET",
url: "foo.php",
username: "foo",
password: "bar"
});
Документацию по всем параметрам jQuery.ajax () можно найти здесь: http://docs.jquery.com/Ajax/jQuery.ajax#options
это, конечно, не ajax, но с клиентом wget вы можете использовать флаги --http-user и --http-password
In general, http://user:pass@example.com
But there are some obvious security shortcomings with that.
A more complete solution may be to set a Session variable after a user is authenticated.
Make the AJAX post to a script that checks authentication. If authenticated, use CURL to fetch the results using a pre-defined authorized account.
This allows you to re-use basic apache auth but prevents any passwords from being written in the DOM.