﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
35446	GET and POST methods not working	Laetitia		"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.POST['title']
  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"	Bug	closed	Error reporting	5.0	Normal	invalid		Laetitia	Unreviewed	0	0	0	0	0	0
