Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

3
  • 1
    great answer! I missed it in the comments. Thanks for putting it here Commented May 8, 2018 at 6:15
  • 1
    and the variation cat ./my_script.py | python manage.py shell Commented Dec 9, 2022 at 17:00
  • 1
    This should be the correct answer, as a one-liner and just works! For anyone looking for this, the 'import script'can be inside a module, e.g. 'import mysite.script'. Works like a charm. Commented May 18, 2023 at 14:47