示例#1
0
文件: views.py 项目: djangosms/core
def loadmsg(request):
    user = request.POST["username"]
    passwd = request.POST["password"]
    user = authenticate(username=user, password=passwd)
    if user is None:
        return Response(status=401)

    text = request.POST["text"]
    sender = request.POST["from"]
    timestamp = request.POST["timestamp"]
    timestamp = datetime.fromtimestamp(float(timestamp))
    transport = Message("http+sms")
    transport.incoming(sender, text, timestamp, True)
    return Response()
示例#2
0
文件: testing.py 项目: djangosms/core
def handle(ident, text, time=None, name="script"):
    transport = Message(name)
    return transport.incoming(ident, text, time)