Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

224
Vistas
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?

about 4 years ago · Santiago Trujillo
2 Respuestas
Responde la pregunta

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
)
about 4 years ago · Santiago Trujillo Denunciar

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 .

about 4 years ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda