8👍
Your issue is with this line
profile.addresses = profile_data.get('addresses', profile.addresses)
As the error message suggests, direct assignment to the reverse side of a relation is not allowed. What you want to do is use set() instead.
profile.addresses.set([list of new addresses])
👤jpm
-2👍
romoving this line may solve your problem:
profile.addresses = profile_data.get('addresses', profile.addresses)
- Get the version of Django for application
- Retrieving the 'many' end of a Generic Foreign Key relationship in Django
- Django – How to filter by date with Django Rest Framework?
- Django – what should you do if you don't need a database engine?
Source:stackexchange.com