I'm trying to deploy the bot’s discord, discord.py / python (link to git) on the service heroku (
link).
The following error appears during deployment:
app [worker.1]: trace (last call was last):
app [worker.1]: file "run.py", line 9, in <module>
app [worker.1]: redis_url = env.get ("REDIS_URL") or "redis: // localhost /"
app [worker.1]: file "/app/bot.py", line 15, in __init__
app [worker.1]: self._fernet_key = fernet.Fernet (env ["FERNET_KEY"]. encode ("utf-8"))
app [worker.1]: NameError: name 'fernet' not defined
Is this error due to the
fernet key? If so, how specify the specified key correctly.Is this error due to an incorrectly specified
redis url? If yes, then how to properly conduct it.If the problem is still something, please indicate this.
UPDATE:
Added to requirements.txt of the main repository:
cryptography == 2.9.2
fernet == 1.0.1
The following error appeared:
app[worker.1]: Traceback (most recent call last):
app[worker.1]: File "run.py", line 9, in <module>
app[worker.1]: redis_url=env.get("REDIS_URL") or "redis://localhost/"
app[worker.1]: File "/app/bot.py", line 16, in __init__
app[worker.1]: self._fernet_key = fernet.Fernet(env["FERNET_KEY"].encode("utf-8"))
app[worker.1]: File "/app/.heroku/python/lib/python3.7/site-packages/cryptography/fernet.py", line 35, in __init__
app[worker.1]: key = base64.urlsafe_b64decode(key)
app[worker.1]: File "/app/.heroku/python/lib/python3.7/base64.py", line 133, in urlsafe_b64decode
app[worker.1]: return b64decode(s)
app[worker.1]: File "/app/.heroku/python/lib/python3.7/base64.py", line 87, in b64decode
app[worker.1]: return binascii.a2b_base64(s)
app[worker.1]: binascii.Error: Incorrect padding