Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If config is placed in .env file #438

Open
gavinchris37 opened this issue Feb 22, 2023 · 1 comment
Open

If config is placed in .env file #438

gavinchris37 opened this issue Feb 22, 2023 · 1 comment

Comments

@gavinchris37
Copy link

from views import ChangeRoute
File "D:\aaapro\limefin\views.py", line 48, in
firebase = pyrebase.initialize_app(CONFIG)
File "D:\aaapro\limefin\lfenv\lib\site-packages\pyrebase\pyrebase.py", line 28, in initialize_app
return Firebase(config)
File "D:\aaapro\limefin\lfenv\lib\site-packages\pyrebase\pyrebase.py", line 34, in init
self.api_key = config["apiKey"]
TypeError: string indices must be integers

@AsifArmanRahman
Copy link

@gavinchris37 you're reading the environment variable as string, thus you're receiving the below error.

TypeError: string indices must be integers


The following snippet should fix it:

import json

firebase = pyrebase.initialize_app(json.loads(CONFIG))


If it helps, please check firebase-rest-api which is uses updated libraries and some new features.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants