Solution 1 :

Your input should be accessed by element name active_state you have given otherwise

like this will be None

special_offer_id = http_request.GET.get('id')

Your render(...) should return HttpResonse with existing template

render(http_request,"template.html",{"context" : 2})

Set DEBUG=True in settings to get the error log

Embed the html in with csrf_token

<form method="POST">
<!-- Your html here -->
{% csrf_token %}

Problem :

I have a submit form like:

<div class="form-group">
    <div class="checkbox">
        <label for="id_active_state">
            <div class="icheckbox_square-red checked" style="position: relative;">
                <input type="checkbox" name="active_state" class="" id="id_active_state" checked=""><ins class="iCheck-helper"></ins>
            </div> active</label>
<div class="form-group">

    <div class="button_holder">
        <button type="submit" name="submit" class="btn btn-primary" value="send">


and it should be handled in view:

def special_offer_edit_view(http_request):
    action_verbose_name = 'the_view'
    special_offer_id = http_request.GET.get('id')
    special_offer_obj = SpecialOffer.objects.filter(id=special_offer_id)
    for data in special_offer_obj:
        sp_obj = {'active_state': data.active_state}

    if http_request.method == 'POST':

    return render(...)

it raises 503 error, and does not send “POST” method and data. what is its problem?


Comment posted by daPhantom

You’re missing a

Comment posted by MHB

render is just like what you wrote, also I used

Comment posted by Yugandhar Chaudhari

Did you get the error log? Otherwise it is difficult to help

Comment posted by MHB

I didn’t used this line

Comment posted by here

You can find more