Forums

DDOS attack? or I've made something wrong

Hello. Thank you for this such a good platform I wanted to buy better account But today my web stopped to answer to my bot response in the Telegram Found in errorlogs that someone sending me so many unrecognized messages.

2018-04-05 18:14:24,900: [2018-04-05 18:14:24,890] ERROR in app: Exception on / [POST]
2018-04-05 18:14:24,901: Traceback (most recent call last):
2018-04-05 18:14:24,901:   File "/home/mavrguis2/venv/lib/python3.6/site-packages/flask/app.py", line 1982, in wsgi_app
2018-04-05 18:14:24,901:     response = self.full_dispatch_request()
2018-04-05 18:14:24,901:   File "/home/mavrguis2/venv/lib/python3.6/site-packages/flask/app.py", line 1614, in full_dispatch_request
2018-04-05 18:14:24,901:     rv = self.handle_user_exception(e)
2018-04-05 18:14:24,901:   File "/home/mavrguis2/venv/lib/python3.6/site-packages/flask/app.py", line 1517, in handle_user_exception
2018-04-05 18:14:24,901:     reraise(exc_type, exc_value, tb)
2018-04-05 18:14:24,901:   File "/home/mavrguis2/venv/lib/python3.6/site-packages/flask/_compat.py", line 33, in reraise
2018-04-05 18:14:24,902:     raise value
2018-04-05 18:14:24,902:   File "/home/mavrguis2/venv/lib/python3.6/site-packages/flask/app.py", line 1612, in full_dispatch_request
2018-04-05 18:14:24,902:     rv = self.dispatch_request()
2018-04-05 18:14:24,902:   File "/home/mavrguis2/venv/lib/python3.6/site-packages/flask/app.py", line 1598, in dispatch_request
2018-04-05 18:14:24,902:     return self.view_functions[rule.endpoint](**req.view_args)
2018-04-05 18:14:24,902:   File "/home/mavrguis2/bot/main.py", line 30, in index
2018-04-05 18:14:24,902:     message=r['message']['text'].upper()
2018-04-05 18:14:24,902: KeyError: 'text'

so i couldnt understand what happening in the internet couldnt find any information like my problem

please help me I need you advice or everything fine and I just should upgrade my account thanks best regards

why <br> doesnt work

[edit by admin: formatting]

When writing a webhook-based Telegram bot, it's best to put your code on a "secret" URL that you only pass on to Telegram themselves, rather than on the root "/" URL of your site, as otherwise any access to your site will hit your code and possibly cause errors like that. See our Telegram bot tutorial for more information.

Thanks, I will read that. can you help me to restore all directories which my account had. I deleted. And nowI can't run anything

Thank you again for information

Why virtualenv venv --python=python3.6 is not working? it puts python 2.7, but i need 3.6

Because the argument to --python is the full path to the Python executable. virtualenv venv --python=/usr/bin/python3.6

grazie mille signore(a)

virtualenv venv --python=/usr/bin/python3.6

this is not working

20:30 ~ $ virtualenv venv --python=/usr/bin/python3.6
Running virtualenv with interpreter /usr/bin/python3.6
Using base prefix '/usr'
New python executable in /home/mavrguis2/venv/bin/python3.6
Also creating executable in /home/mavrguis2/venv/bin/python
Installing setuptools, pip, wheel...done.
20:30 ~ $ pip --version
pip 8.1.2 from /usr/local/lib/python2.7/dist-packages (python 2.7)

do you need to activate it after you create it?

yes, i need to activate. Web app also I want to choose python 3.6

yes, i need to activate. Web app also I want to choose python 3.6

ok- so if you don't activate it, then the pip will be the wrong version until you activate it?

for the webapp, you can choose the python version from the PythonAnywhere webapps tab settings. also be sure to set your virtualenv there.

grazie mille

Glad you worked it out!

             / ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄ ̄\
<<<<<<:>~  <   Yay!          |
             \_________/