#34516: request.post is null
-------------------------------+--------------------------------------
     Reporter:  abtin1238      |                    Owner:  nobody
         Type:  Uncategorized  |                   Status:  new
    Component:  Uncategorized  |                  Version:  4.2
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Unreviewed
    Has patch:  0              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by abtin1238:

Old description:

> ef submit_expense(request):
>     ###user submit expense###
>     #TODO:
>
>     this_token = request.POST.get("token")
>

>
>     return JsonResponse({
>         "token": this_token
>     } )
> why this code return null

New description:

 from django.shortcuts import render
 from django.http import JsonResponse
 from json import JSONEncoder
 from django.views.decorators.csrf import csrf_exempt
 from web.models import User,Token,Expense,Income
 from datetime import datetime
 # Create your views here.
 @csrf_exempt
 def submit_expense(request):
     this_token = request.POST.get("token")
     return JsonResponse({
         "token": this_token
     } )

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34516#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/01070187b8e54c9a-85c8235c-dbea-48f3-b083-05579e19911a-000000%40eu-central-1.amazonses.com.

Reply via email to