odysseusmax / tg-index

Python web app to index telegram chats and serve its files for download over HTTP.
GNU General Public License v3.0
383 stars 468 forks source link

Guide for enviorement variables #25

Open lit34 opened 3 years ago

lit34 commented 3 years ago

Can you please tell me how to put those values in a file? What is the syntax? I created a .env file but I get this error: raise KeyError(key) from None KeyError: 'API_ID'

viper-adnan commented 3 years ago

Use these commands to set environment variables

export API_ID=8191919
export API_HASH="8hwhw91j282uw8wj"

And so on...

pseudokawaii commented 3 years ago

@lit34 if you are talking about repl.it deployment, it doesn't require you to create the .env file yourself anymore, you can set them as keys and values in the secrets tab of the IDE ~

image

simonlkch commented 3 years ago

Use these commands to set environment variables

export API_ID=8191919
export API_HASH="8hwhw91j282uw8wj"

And so on...

how can i use .env instead of export the env value?

rayanfer32 commented 3 years ago

Use these commands to set environment variables

export API_ID=8191919
export API_HASH="8hwhw91j282uw8wj"

And so on...

how can i use .env instead of export the env value?

I suppose you can use the python_dotenv module and load the .env file , I havent tested it though on repl.it