Opened 7 months ago
Closed 7 months ago
#35446 closed Bug (invalid)
GET and POST methods not working
Reported by: | Laetitia | Owned by: | |
---|---|---|---|
Component: | Error reporting | Version: | 5.0 |
Severity: | Normal | Keywords: | |
Cc: | Laetitia | Triage Stage: | Unreviewed |
Has patch: | no | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
Good day,
Please assist me. I am busy with a Django project. I am working on Windows 10 with WSL Ubuntu installed together with VSCode. I keep on getting errors when it comes to the GET and POST methods. I can't seem to find the bug. Please see below a snippet of the error I get. Will provide snippets of the actual code if needed.
Environment:
Request Method: POST
Request URL: http://127.0.0.1:8000/new/
Django Version: 5.0.4
Python Version: 3.10.12
Installed Applications:
['encyclopedia',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles']
Installed Middleware:
['django.middleware.security.SecurityMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware']
Traceback (most recent call last):
File "/home/laetitia/.local/lib/python3.10/site-packages/django/utils/datastructures.py", line 84, in getitem
list_ = super().getitem(key)
During handling of the above exception ('title'), another exception occurred:
File "/home/laetitia/.local/lib/python3.10/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/home/laetitia/.local/lib/python3.10/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, callback_kwargs)
File "/home/laetitia/cs50w/wiki/encyclopedia/views.py", line 56, in new_page
title = request.POSTtitle
File "/home/laetitia/.local/lib/python3.10/site-packages/django/utils/datastructures.py", line 86, in getitem
raise MultiValueDictKeyError(key)
Exception Type: MultiValueDictKeyError at /new/
Exception Value: 'title'
Kind regards,
Laetitia
See TicketClosingReasons/UseSupportChannels.