- Fork and clone the project in your device.
pipenv shellpipenv install
Below steps talk about creating and securing your firebase admin credentials, this step needs to be
done only once for setting up your .env file.
- Go to Firebase console and create a firebase project.
- In firebase console go to settings > Service accounts
- Click Generate New Private Key, then confirm by clicking Generate Key.
- Securely store the JSON file containing the key. Encrypt your Json file containing key using steps code given below:
- Below code will generate a file named
firebase_admin.aes, so if you already have this file(as it was present earlier on the repo) you may delete that file and then run below code..
import pyAesCrypt
bufferSize = 64 * 1024
password = "please-use-a-long-and-random-password"
# encrypt
# Here firebase_admin.json is the name of Json file you get from from firebase.
pyAesCrypt.encryptFile("firebase_admin.json", "firebase_admin.aes", password, bufferSize)- Keep this
firebase_admin.aesfile inside the project atmanage.pylevel. - At the same directory level create a file named
.envand put contents into it by copying from another file namedtemplate_envwhich is already present. - In your
.envput value ofFIREBASE_DECRYPT_KEYas the password you used for encrypting. - Similarly update the value of
FIREBASE_DECRYPT_SIZEas based on what you get as output.
You have successfully created required environment variables.
- Now you can apply the migrations and start the server