'POST /api/user/v1/accounts/{username}/image'

def post(self, request, username):

    if ('file' not in request.FILES):
        return Response({'developer_message': u'No    file    provided    for    profile    image', 'user_message': _(u'No    file    provided    for    profile    image')}, status=status.HTTP_400_BAD_REQUEST)
    uploaded_file = request.FILES['file']
    with closing(uploaded_file):
        try:
            validate_uploaded_image(uploaded_file)
        except ImageValidationError as error:
            return Response({'developer_message': error.message, 'user_message': error.user_message}, status=status.HTTP_400_BAD_REQUEST)
        profile_image_names = get_profile_image_names(username)
        create_profile_images(uploaded_file, profile_image_names)
        set_has_profile_image(username, True, _make_upload_dt())
        log.info(LOG_MESSAGE_CREATE, {'image_names': profile_image_names.values(), 'user_id': request.user.id})
    return Response(status=status.HTTP_204_NO_CONTENT)
