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

196
Vistas
Debug from Django admin

I'm trying to have a print statement appear on the console every time I add data into my Postgres Database (For example "Post succeeded") from the Django admin but no matter where I put print statements (in admin.py or the models) nothing is appearing. I know the data is going through as there is a POST statement that goes through example of post going through
and the data is in the database.

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

0

In your Admin object, you can put a print statement in the save_model() method. It sounds like that's where it will best suit you if you want to print something after adding data.

It would look something like this:

class FooAdmin(admin.ModelAdmin):
    ...

    class Meta:
        model = Foo

    def save_model(self, request, obj, form, change):
        print('Post succeeded')
        obj.save()

admin.site.register(Foo, FooAdmin)
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