Env variable seems not being read

I’m currently learning how to make a message reply bot. It’s my first time using this kind of thing. Please forgive me if I make any simple mistakes.

My program code uses some environment variables such as CHANNEL_ACCESS_TOKEN, but NameError appears in the program code. I would like to know what went wrong. Is my usage method wrong?

Hi there,

In Python, you should use os.getenv('CHANNEL_ACCESS_TOKEN')to get the value for an environment variable.


Render Support, UTC+10 :australia:

It works! Thanks a lot!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.