0Pricing
Django Academy · Lektion

shell_plus und bessere Tools

Beschleunigen Sie die Arbeit in der Shell mit django-extensions.

shell_plus und bessere Tools ist eine kostenlose Django Academy-Lektion auf CoddyKit. Dies ist Lektion 4 von 4. Du kannst die komplette Lektion unten kostenlos lesen – dann übst du sie direkt im Browser mit einem integrierten Code-Editor und einem KI-Tutor rund um die Uhr. Sie ist Teil des Django Academy-Lernpfads, und dein Fortschritt wird über Web und CoddyKit-App synchronisiert. Der Django Academy-Kurs umfasst insgesamt 4 Lektionen.

Teile dieser Lektion wurden noch nicht übersetzt und werden auf Englisch angezeigt.

The Tedious Part

The default shell makes you import every model by hand each session. That repetition gets old fast on real projects.

Meet shell_plus

shell_plus is an upgraded shell from the django-extensions package. It auto-imports your models and common helpers for you.

Install the Package

First add the tool with pip. django-extensions bundles shell_plus along with many other handy commands.

pip install django-extensions

Register It in Settings

Next add it to INSTALLED_APPS so Django loads the new commands. Without this step the shell_plus command stays hidden.

INSTALLED_APPS = [
    "django_extensions",
]

Launch shell_plus

Now start it through manage.py just like the regular shell. On startup it prints every model it imported for you.

python manage.py shell_plus

Models Are Just There

No imports needed: Post, Comment, and the rest are ready instantly. You jump straight into querying your data.

>>> Post.objects.count()

See the SQL It Runs

Add the print-sql flag to echo the SQL behind each query. It is a great way to learn what the ORM generates.

python manage.py shell_plus --print-sql

Nicer with IPython

If IPython is installed, shell_plus uses it automatically. You get syntax colors, tab completion, and command history.

pip install ipython

Tab Completion Saves Time

With IPython you press Tab to autocomplete model and method names. Less typing means fewer mistakes while you explore.

More Than a Shell

django-extensions also adds tools like graph_models to draw your schema. shell_plus is just the most loved one.

Keep It Dev-Only

These extras are development helpers. Put them in your dev requirements so they do not ship to production servers.

Quick Check

What is the main perk of shell_plus?

Recap

You installed django-extensions, launched shell_plus with auto-imported models, viewed SQL, and added IPython for a smoother session. 🚀

Häufig gestellte Fragen

Ist die Lektion „shell_plus und bessere Tools“ kostenlos?

Ja — der vollständige Text von „shell_plus und bessere Tools“ ist hier im Web kostenlos zu lesen. Um sie interaktiv zu üben (integrierter Code-Editor und 24/7 KI-Tutor) und den Rest des Django Academy-Kurses freizuschalten, upgrade auf CoddyKit PRO. Der Django Academy-Kurs umfasst insgesamt 4 Lektionen.

Was lerne ich in „shell_plus und bessere Tools“?

Beschleunigen Sie die Arbeit in der Shell mit django-extensions. Du übst Django Academy mit praktischem Code, den du direkt im Browser ausführst, und ein 24/7 KI-Tutor beantwortet deine Fragen während du die Lektion bearbeitest.

Brauche ich Erfahrung, um Django Academy zu starten?

Keine Vorkenntnisse erforderlich. Django Academy auf CoddyKit ist für Anfänger bis fortgeschrittene Lernende strukturiert, sodass du hier starten oder von Anfang an beginnen und in deinem eigenen Tempo voranschreiten kannst. Dies ist Lektion 4 von 4.

Wie lange dauert die Lektion „shell_plus und bessere Tools“?

Die meisten CoddyKit-Lektionen dauern etwa 5–10 Minuten. Jede ist kompakt und interaktiv, sodass du stetig Fortschritte machst und genau dort weitermachst, wo du aufgehört hast – im Web und in der App.

Kann ich in dieser Django Academy-Lektion Code schreiben und ausführen?

Ja. Jede Django Academy-Lektion enthält einen integrierten Code-Editor, sodass du echten Code direkt in deinem Browser schreibst und ausführst und sofort KI-Feedback erhältst — ohne lokale Einrichtung erforderlich.

Alle Lektionen in diesem Kurs

  1. python manage.py shell starten
  2. Models importieren und untersuchen
  3. Objekte live erstellen und speichern
  4. shell_plus und bessere Tools
← Zurück zu Django Academy