Неправильное заполнение при попытке обновить изображение профиля

My project is built on React and Django. I would like to enable users to update profile information. Noticed that I was initially getting a 304 error when it specifically comes to updating the profile picture. and realized that this had something to do with Django requiring multipart form data. I then tried to upload the profile picture using a base64 encoding string, but now getting the error

Неправильное заполнение

Здесь представлен мой serializers.py:

Я передаю свою обновленную информацию с помощью этой функции:

const updateProfile = (userData) => {
        console.log('userData', userData)
        //we pass profile information through token payload, so let's get a new token
        const refreshToken = {
            'refresh': authTokens.refresh
        }
        console.log(refreshToken)
        axios.put(`http://127.0.0.1:8000/update_profile/${userData.user_id}/`, userData)
            .then(res => {
                console.log(res.data)
    ...

Здесь приведен пример некоторой информации, которую я отправил

Вернуться на верх