Code


Version 1 (modified by Dyadya Zed, 7 years ago) (diff)

--

Sometimes printing variable or object contents saves you a lot of time. It will work if you have DEBUG = True

in your settings.py

You can put in your views

raise Exception(your_variable_here)

to see variable data. It will work for dictionaries, lists, objects(you'll see references) etc

Also you can list object attributes:

raise Exception(dir(some_object))

or all internal object fields:

raise Exception(some_object.__dict__)

information was found on Software Maniacs forums