title: How to execute external script in the Django environment
body: <p>I am trying to execute an external snippet for debugging and terminal-like purposes in the environment the Django console uses so it can connect to the db, etc.</p>
  
  <p>Basically, I am just using it for the same reason one would fiddle with the console but I am using longer snippets to output some formatted information so it is handy to have that code in an actual file manipulated with an IDE.</p>
  
  <p>An answer said you could do that by executing <code>python manage.py shell &lt; snippet.py</code> but I did not see a successfull result. And although no errors are reported, I am not getting the excepted output, but only a series of <code>&gt;&gt;&gt;</code> prompts.</p>
  
  <p>So how can I do this?</p>
  
  <p>By the way, I am using PyCharm, in case this IDE has a shorthand way of doing this or any special tool.</p>