How do I get X-Amz-Security-Token param with boto or django-storages?

It’s a Django project, I use django-storages and boto3. I use Amazon S3 to store files. Files are private, so a presigned URL is needed to access them.

How do I get X-Amz-Security-Token param with boto3 or django-storages?

This is the code is use to get presigned url:

    client = boto3.client('s3',

    file_path = "private/0001.dcm" // copied directly from Amazon bucket account on key value
    response = client.generate_presigned_url('get_object',
                                                    Params={'Bucket': BUCKET_NAME,
                                                            'Key': file_path},

The URL I get with this code is short, X-Amz-Security-Token and it doesn’t work.

The presigned URL I get on my Amazon account is very long and it works fine.

How do I get presigned url with X-Amz-Security-Token in Python?