def create(self, validated_data):
target_languages = validated_data.pop('target_languages')
user = User.objects.create(**validated_data)
for target_language in target_languages:
user.target_languages.add(get_object_or_404(Language, iso_639_1=target_language))
user.save()
return user
[uwsgi]
socket = /home/ubuntu/contacts/project/contacts.sock
virtualenv = /home/ubuntu/contacts/ENV
chdir = /home/ubuntu/contacts/project
master = True
workers = 8
module = project.wsgi:application
plugin = python
uid = www-data
gid = www-data
chmod-socket = 777
chown-socket = www-data