Launching python manage.py shell
Open a shell with your project loaded.
Launching python manage.py shell is a free Django Academy lesson on CoddyKit — lesson 1 of 4. You can read the complete lesson below for free — then practise it hands-on in the browser with a built-in code editor and a 24/7 AI tutor. It is part of the Django Academy learning path, one of 4 lessons in the course, and your progress syncs across the web and the CoddyKit app.
A Playground for Your Project
The Django shell is an interactive Python session that already knows about your project, so you can test ideas live without writing a file. 🧪
Why Not Just python?
Plain python can not import your models, because Django settings are not loaded. The shell command wires everything up for you first.
The One Command
You launch it through manage.py, the same script you use for everything else. It loads settings, then drops you into Python.
python manage.py shellRun It from the Project Root
Run the command in the folder that holds manage.py. From there Django can find your settings and apps with no extra setup.
What the Prompt Looks Like
Once it starts, you see the familiar Python prompt with three chevrons. Anything you type runs instantly and shows its result.
>>> 2 + 2
4Settings Are Already Loaded
Because settings are configured, you can read project values right away. Try printing your DEBUG flag to confirm the shell sees them.
>>> from django.conf import settings
>>> settings.DEBUG
TrueImport and Explore
Now any model or utility is one import away. The shell is perfect for poking at code before you commit it to a file.
Multi-Line Blocks Work Too
You are not limited to one-liners. Start a loop or function and the prompt switches to dots until the block is complete.
>>> for i in range(3):
... print(i)Leaving the Shell
When you are done, type exit() or press Ctrl-D to return to your normal terminal. Nothing you typed is saved to disk.
>>> exit()It Is Throwaway by Design
Treat the shell as a scratchpad. It is ideal for experiments, but real changes belong in views, models, or scripts you can rerun.
Database Writes Are Real
One caution: queries hit your real database. Saving an object in the shell changes data for good, so be careful on production.
Quick Check
Why use the Django shell instead of plain python?
Recap
You learned that manage.py shell opens an interactive Python session with your project loaded, perfect for quick experiments before writing real code. 🎉
Frequently asked questions
Is the “Launching python manage.py shell” lesson free?
Yes — the full text of “Launching python manage.py shell” is free to read here on the web, and the Django Academy course includes 4 lessons in total. To practise it interactively (a built-in code editor and a 24/7 AI tutor) and unlock the rest of the Django Academy course, upgrade to CoddyKit PRO.
What will I learn in “Launching python manage.py shell”?
Open a shell with your project loaded. You practise Django Academy with hands-on code you run directly in the browser, and a 24/7 AI tutor answers your questions as you work through the lesson.
Do I need any experience to start Django Academy?
No prior experience is required. Django Academy on CoddyKit is structured for beginners through advanced learners; this is — lesson 1 of 4, so you can start here or from the beginning and move at your own pace.
How long does the “Launching python manage.py shell” lesson take?
Most CoddyKit lessons take about 5–10 minutes. Each one is bite-sized and interactive, so you make steady progress and pick up exactly where you left off across the web and the app.
Can I write and run code in this Django Academy lesson?
Yes. Every Django Academy lesson includes a built-in code editor, so you write and run real code right in your browser and get instant AI feedback — no local setup required.
All lessons in this course
- Launching python manage.py shell
- Importing and Inspecting Models
- Creating and Saving Objects Live
- shell_plus and Better Tooling