support avatar upload;

use middleware to operate session data.
This commit is contained in:
zema1
2017-09-19 19:10:50 +08:00
parent 1ee0596a3a
commit 034ad59f2e
13 changed files with 72 additions and 65 deletions

View File

@@ -1,5 +1,6 @@
import logging
import random
import datetime
from io import BytesIO
from base64 import b64encode
@@ -78,3 +79,7 @@ def datetime2str(value, format="iso-8601"):
value = value[:-6] + "Z"
return value
return value.strftime(format)
def timestamp2utcstr(value):
return datetime.datetime.utcfromtimestamp(value).isoformat()