views.py

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
from django.http import HttpResponse
from django.shortcuts import render_to_response
from django.views.decorators.http import require_http_methods
from django.core import serializers
from django.utils import simplejson
import re
@require_http_methods(["GET"])
def pars(request):
bordertbl = request.GET['border']
cellpaddingtbl = request.GET['cellpadding']
cellspacingtbl = request.GET['cellspacing']
classtbl = request.GET['class']
width = request.GET['width']
text_tbl = request.GET['message']
text_tbl = text_tbl.replace('<TR', '<tr')
text_tbl = text_tbl.replace('<TD', '<td')
data = text_tbl
return HttpResponse(data)