В конфиг nginx в раздел http добавляется строка
а в php.ini
server_tokens off;
а в php.ini
expose_php = Off
server_tokens off;
expose_php = Off
from datetime import datetime, timedelta import tornado.escape class MyApplication(): def get_expire_time(self): start = datetime.now() session_length = self.settings['session_time'] delta = timedelta(seconds=session_length) expires = start + delta return expires def save_session(self, data) end_time = time.mktime(self.get_expire_time().timetuple()) self.mc.set(key, tornado.escape.json_encode(data), end_time)Навеяно StackOverflow
from email.mime.multipart import MIMEMultipart from email.mime.text import MIMEText import quopri def QuoHead(String): s = quopri.encodestring(String.encode('UTF-8'), 1, 0) return "=?utf-8?Q?" + s.decode('UTF-8') + "?=" FIOin = "Андрей Петрович" emailout = "some@test.ru" emailin = "some2@test.ru" msg = MIMEMultipart() msg["Subject"] = QuoHead("Добрый день " + FIOin).replace('=\n', '') msg["From"] = (QuoHead("Ирина Федоровна") + " <" + emailout + ">").replace('=\n', '') msg["To"] = (QuoHead(FIOin) + " <" + emailin + ">").replace('=\n', '') m = """Добрый день. Это тестовое письмо. Пожалуйста, не отвечайте на него.""" text = MIMEText(m.encode('utf-8'), 'plain', 'UTF-8') msg.attach(text) print(msg.as_string())