Я пытаюсь получить данные о firebase из python (2.7).Аутентификация пользователей Firebase в python
Вот мои правила (на firebseio.com):
{
"rules": {
"user": {
"$uid": {
".read": "auth != null && auth.uid == $uid",
".write": "auth != null && auth.uid == $uid"
}
}
}
}
Вот скриншот моего Databse:
И наконец, мой питон код:
from firebase import firebase
from firebase.firebase import FirebaseApplication, FirebaseAuthentication
DSN = 'https://<my name>.localhost'
EMAIL = '[email protected]'
authentication = FirebaseAuthentication(EMAIL, True, True, extra={'id': '<the user id>'})
firebase = FirebaseApplication(DSN, authentication)
firebase.authentication = authentication
print authentication.extra
user = authentication.get_user()
print user.firebase_auth_token
Теперь я не могу понять, как получить данные и отправить данные в и из базы огня. I судимого использованияКонтактной строку: result = firebase.get('/users', None, {'print': 'pretty'})
, но это дает мне эту ошибку:
ConnectionError: HTTPSConnectionPool(host='<my name>.localhost', port=443): Max retries exceeded with url: /users/.json?print=pretty&auth=<the token code of the user> (Caused by NewConnectionError('<requests.packages.urllib3.connection.VerifiedHTTPSConnection object at 0x02A913B0>: Failed to establish a new connection: [Errno 11001] getaddrinfo failed',))
Может кто-нибудь дать мне рабочий код?
Спасибо заранее,
Цви Карп
Что делать, если я не использую DSN? – marciokoko