I've been working on Django-rest-framework for past few months. I did not quite understood how the json request can be used.Can you please help me, I got stuck here for months.
I have a third-party html snippet on another website and lets assume it sends this json data
[{"idcomment":1,"isFlagged":false,"isDeleted":false,"isApproved":true,"createdAt":"2015-11-22T12:39:33Z","numReports":0,"isEdited":false,"message":"xcvvzvc","isSpam":false,"isHighlighted":false,"ip_address":"","is_public":true,"tree_path":"0000000001","tone":"Neutral","forum":1,"parent":null,"topic":1,"last_child":null,"user":1}][{"idcomment":1,"isFlagged":false,"isDeleted":false,"isApproved":true,"createdAt":"2015-11-22T12:39:33Z","numReports":0,"isEdited":false,"message":"xcvvzvc","isSpam":false,"isHighlighted":false,"ip_address":"","is_public":true,"tree_path":"0000000001","tone":"Neutral","forum":1,"parent":null,"topic":1,"last_child":null,"user":1}]
My question: How can I use this json request data and do some verification like if the comment belongs to the correct topic.
I couldn't find any examples where its done. So I figured its possible in Flask by using something like this.
mod.route("/create/", methods=["POST"])
def create():
    json = getJson(request)
    check_required(json, ['date', 'thread', 'message', 'user', 'forum'])
    uid = id_by_email(json['user'])
    fid = id_by_sname(json['forum'])
    if uid < 0 or fid < 0:
        return send_resp(json)
    if 'parent' in json:
        parent = json['parent']
    else:
        parent = None
        json['parent'] = None
    if 'isApproved' in json:
        approved = json['isApproved']
    else:
        approved = 0
        json['isApproved'] = 0
    if 'isHighlighted' in json:
        highlighted = json['isHighlighted']
    else:
        highlighted = 0
        json['isHighlighted'] = 0
    if 'isEdited' in json:
        edited = json['isEdited']
    else:
        edited = 0
        json['isEdited'] = 0
    if 'isSpam' in json:
        spam = json['isSpam']
    else:
        spam = 0
        json['isSpam'] = 0
    if 'isDeleted' in json:
        deleted = json['isDeleted']
    else:
        deleted = 0
        json['isDeleted'] = 0
    db.insert("""INSERT INTO posts (date,thread_id,message,user_id,forum_id,parent,approved,highlighted,edited,spam,deleted) 
                values (%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)""", (
        json['date'], json['thread'], json['message'], uid, fid, parent, approved, highlighted, edited, spam, deleted))
    pid = db.query("SELECT LAST_INSERT_ID() as id")[0]['id']
    json['id'] = pid
    return send_resp(json)
What is the alternative for something like this in django-rest-framework.
I am quite new, so please explain in simple language. I don't need any code, just searching how can I use json requests I get to the server.
It's a no-brainer I read the documentation several times
Disclaimer: I have also gonna all over through the django-rest-framework code