Python django framewОжидалось, что из представления будет возвращен `Response`, `HttpResponse` или `HttpStreamingResponse`, но получено `<class 'NoneType'>`.
def post(self,request):
try:
profile_image=request.FILES['profile_image']
except:
profile_image=""
full_name=request.data.get('full_image')
email=request.data.get('email')
mobile_number=request.data.get('mobile_number')
gender=request.data.get('gender')
print(is_alcoholic)
dob=request.data.get('dob')
country=request.data.get('country')
state=request.data.get('state')
city=request.data.get('city')
Функции Python возвращают None
, если они не выполняют оператор return something
, чтобы вернуть something
.
Этот вид отваливается от конца и по умолчанию возвращает None
Обычно возвращается redirect, чтобы указать, что браузер покажет пользователю дальше.