Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6387861
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:12:19+00:00 2026-05-25T03:12:19+00:00

Django framework. Html form. views.py script. I have a form with multiple checkboxes, the

  • 0

Django framework. Html form. views.py script.

I have a form with multiple checkboxes, the user chooses a checkbox in correspondence with what files they would like to download in a zip file. When all boxes are checked, a zip file is created and able to download however whenever a checkbox is unchecked I get the following error:

MultiValueDictKeyError at /qatools/debug/logs/
Key ‘logs’ not found in QueryDict:

My validation is as follows. It is determines whether a checkbox has been checked and assigns either a 0 or 1 as it is in the format that it calls a shell script.

    logs = 0
    if request.POST.get & request.POST['logs'] == "on":
        logs = 1
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:12:20+00:00Added an answer on May 25, 2026 at 3:12 am

    This is a standard issue with HTML forms … on the POST an unchecked checkbox will NOT EXIST in the POST values, not have a value of ‘off’ as expected. So you need to check for existence:

    logs = 0
    if request.POST.get and 'logs' in request.POST and request.POST['logs'] == "on":
        logs = 1
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm learning Python now because of the Django framework. I have been a Perl
I have a django site using the basic django registration framework. I have my
In my web projects (Django framework) I typically have a few internally developed JavaScript
I've spent a lot of time working in Django, and have grokked the framework
I have a html file ('search.html') with a form on it. I have saved
I have a web service with Django Framework. My friend's project is a WIN32
I write code with Python using Django framework. Now I have read about all
I am using django feed framework. This is what I have in my feeds.py:
In django framework,When there are changes in urls.py or model.py or views.py .We would
I am using the django framework and am using templates, inheriting a lot of

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.