i have a problem with dynaconf .secrets

kahcepba
TRIAL

a year ago

when i ru me telegram botlocally - it works fine.
But when i deploy it to railway, i receive this error. Help

I use Dynaconf settings.toml and .secrets.toml

Traceback (most recent call last):
File "/app/bot.py", line 27, in
bot = Bot(settings.BOTTOKEN) File "/opt/venv/lib/python3.9/site-packages/aiogram/bot/base.py", line 77, in init api.checktoken(token)
File "/opt/venv/lib/python3.9/site-packages/aiogram/bot/api.py", line 75, in check_token
raise exceptions.ValidationError('Token is invalid!')

View Deploy details

> ⓘ Deployment information is only viewable by Project members and Railway admins.

Archived

2 Replies

a year ago

Please use environment variables for sensitive information such as a bot token.


kahcepba
TRIAL

a year ago

Please use environment variables for sensitive information such as a bot token.

Thanks. And what should I write in the bot code?
Could you describe it in more detail?


a year ago

I'm sorry but we wouldn't be able to offer coding help here, these forums are designed for platform help.

I would recommend reading up on how to use environment variables with your language, here are the docs on how you add environment variables to your Railway service - https://docs.railway.app/guides/variables#service-variables

Status changed to Archived brody over 1 year ago