def render_GET(self,request): to = request.args['to'] content = request.args['content'] key = request.args['key'] print key[0] ap = Program.objects.filter(key=key[0]) if ap and to[0]!='88253141': Outbox.objects.create(phone = to[0], content = content[0],processed=False,app=ap[0]) template = template_env.get_template('index.html') return template.render().encode('utf-8') template = template_env.get_template('notfound.html') return template.render().encode('utf-8')
def render_GET(self,request): to = request.args['to'] content = request.args['content'] to=to[0] to = to[-8:] firstword = content[0].split(' ')[0] msgObj=Message.objects.create(phone=to, content=content[0]) for rule in Rule.objects.all(): if firstword==rule.keyword: UserInbox.objects.create(user=rule.user,message=msgObj) #message.g huleen awlaa gej message ywuulj bga uchir neg message ywuulsan gj tootson nemeduulne rule.user.send_message_increment(to,'tanii message.g huleen awlaa bayrlalaa') template = template_env.get_template('index.html') return template.render().encode('utf-8')
def render_GET(self,request): self.work() template = template_env.get_template('index.html') return template.render().encode('utf-8')