|   | 1 | Sometimes printing variable or object contents saves you a lot of time. It will work if you have DEBUG = True | 
          
          
            |   | 2 |  in your settings.py | 
          
          
            |   | 3 |  | 
          
          
            |   | 4 | You can put in your views | 
          
          
            |   | 5 |  | 
          
          
            |   | 6 | {{{ | 
          
          
            |   | 7 | raise Exception(your_variable_here) | 
          
          
            |   | 8 | }}} | 
          
          
            |   | 9 |  | 
          
          
            |   | 10 | to see variable data. It will work for dictionaries, lists, objects(you'll see references) etc | 
          
          
            |   | 11 |  | 
          
          
            |   | 12 | Also you can list object attributes: | 
          
          
            |   | 13 |  | 
          
          
            |   | 14 | {{{ | 
          
          
            |   | 15 | raise Exception(dir(some_object)) | 
          
          
            |   | 16 | }}} | 
          
          
            |   | 17 |  | 
          
          
            |   | 18 | or all internal object fields: | 
          
          
            |   | 19 |  | 
          
          
            |   | 20 | {{{ | 
          
          
            |   | 21 | raise Exception(some_object.__dict__) | 
          
          
            |   | 22 | }}} | 
          
          
            |   | 23 |  | 
          
          
            |   | 24 | information was found on [http://softwaremaniacs.org/forum/ Software Maniacs forums] | 
          
          
            |   | 25 |  | 
          
          
            |   | 26 |  | 
          
          
            |   | 27 |  |