Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

229
Views
How to create a URL for a s3 photo without expiration?

I'm using a Django User models to store my users. My user will have the usual: name, username, password.

Here's an example:

class UserProfile(models.Model):
    user = models.OneToOneField(User, primary_key=True)
    photo_url = models.CharField(max_length=200, blank=True, default='') # the url to fetch photo

There will be one field that I will need to generate a url for and that is the url for the photo he uploaded to S3, that way my client can download it and display it.

What's the best way to generate an indefinite url in boto3?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

From: Generating Presigned URLs. There is no way to specify a non-expiring URL. Use a large int value for ExpiresIn parameter. Try it.

import boto3
import requests

# Get the service client.
s3 = boto3.client('s3')

# Generate the URL to get 'key-name' from 'bucket-name'
url = s3.generate_presigned_url(
    ClientMethod='get_object',
    Params={
        'Bucket': 'bucket-name',
        'Key': 'key-name'
    },
    ExpiresIn=9999999999
)
over 4 years ago · Santiago Trujillo Report

0

actually we cannot create a presigned url without expiration ,the maximum period of expiration is one week for S3 version 4 and for v2 it might be higher .

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!