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

195
Views
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 answers
Answer question

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 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!