- Fork and clone the project in your device.
pipenv shell(If you're not aware of what pipenv, have look at this blog).pipenv 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.
- Save the Json file containing key details, with name
firebase_admin.jsonin same level directory as manage.py. - Open a file named
encrypt_credentials.pyalready present in same directory, and edit the password(line: 6) you want to use for encryption. Note: You are advised to use long and random password, as you do not need to remember it after that. - Run
python encrypt_credentials.pyto encrypt your Json file. This will generate a file namedfirebase_admin.aesand will also printFIREBASE_DECRYPT_SIZEin the output. - Create a file named
.envand copy contents into it from another file namedtemplate_envwhich is already present. - In your
.envfile put the value ofFIREBASE_DECRYPT_KEYas the password you used for encryption, andFIREBASE_DECRYPT_SIZEas the number generated in output that came after encrypting the file. - Undo the changes you made to encrypt_credentials.py(that is again make the password as
please-use-a-long-random-password), otherwise your encryption key(password) will become public.
You have successfully created required environment variables.
- Now you can apply the migrations and start the server