Django postgres raise notice

Let's say that I have a postgres function that raise multiple notices. Example:

function testnotice
...
raise notice 'test'
raise notice 'test-2'

When I execute this function from django,

cursor.execute("select testnotice()")

Is there any posibility to retrive the notifications ?

I tried the answer from: Python2 print postgresql stored procedure raise notice

But I get AttributeError: 'DatabaseWrapper' object has no attribute 'notices' on Python 2.7

Any helpful ideas ? Thank you.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum