第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

AttributeError:“str”對象沒有屬性“get”(django 視圖)

AttributeError:“str”對象沒有屬性“get”(django 視圖)

慕的地8271018 2022-12-06 15:33:14
這是ajax操作和django視圖之間的通信。有一個表單,如果我點擊表單的提交按鈕,就會執(zhí)行 Ajax 代碼。但它總是出錯,寫在下面。我無法弄清楚它的原因。我想這與如何將表單傳遞給視圖有關,但我不知道如何解決。Internal Server Error: /makeeventTraceback (most recent call last):  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/exception.py", line 34, in inner    response = get_response(request)  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 115, in _get_response    response = self.process_exception_by_middleware(e, request)  File "/usr/local/lib/python3.7/site-packages/django/core/handlers/base.py", line 113, in _get_response    response = wrapped_callback(request, *callback_args, **callback_kwargs)  File "/workspace/CalendarProject/cencal/views.py", line 42, in makeevent    if form.is_valid():  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py", line 185, in is_valid    return self.is_bound and not self.errors  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py", line 180, in errors    self.full_clean()  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py", line 381, in full_clean    self._clean_fields()  File "/usr/local/lib/python3.7/site-packages/django/forms/forms.py", line 393, in _clean_fields    value = field.widget.value_from_datadict(self.data, self.files, self.add_prefix(name))  File "/usr/local/lib/python3.7/site-packages/django/forms/widgets.py", line 258, in value_from_datadict    return data.get(name)AttributeError: 'str' object has no attribute 'get'
查看完整描述

1 回答

?
慕姐4208626

TA貢獻1852條經(jīng)驗 獲得超7個贊

嘗試 Jsonify 響應字符串。示例:HttpResponse({ "Status": "Successful" })



查看完整回答
反對 回復 2022-12-06
  • 1 回答
  • 0 關注
  • 206 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網(wǎng)微信公眾號