0Pricing
Django Academy · Lección

Iniciar python manage.py shell

Abra una shell con su proyecto cargado

Iniciar python manage.py shell es una lección gratuita de Django Academy en CoddyKit. Esta es la lección 1 de 4. Puedes leer la lección completa abajo gratuitamente — luego la practicas en el navegador con un editor de código integrado y un tutor de IA 24/7. Forma parte de la ruta de aprendizaje de Django Academy, y tu progreso se sincroniza en la web y la app de CoddyKit. El curso de Django Academy incluye 4 lecciones en total.

Partes de esta lección aún no han sido traducidas y se muestran en inglés.

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 shell

Run 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
4

Settings 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
True

Import 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. 🎉

Preguntas frecuentes

¿La lección «Iniciar python manage.py shell» es gratis?

Sí — el texto completo de «Iniciar python manage.py shell» es gratis para leer aquí en la web. Para practicarla de forma interactiva (editor de código integrado y tutor de IA 24/7) y desbloquear el resto del curso de Django Academy, actualiza a CoddyKit PRO. El curso de Django Academy incluye 4 lecciones en total.

¿Qué aprenderé en «Iniciar python manage.py shell»?

Abra una shell con su proyecto cargado Practicas Django Academy con código real que ejecutas directamente en el navegador, y un tutor de IA 24/7 responde tus preguntas mientras trabajas en la lección.

¿Necesito experiencia previa para empezar Django Academy?

No se requiere experiencia previa. Django Academy en CoddyKit está estructurado para principiantes hasta estudiantes avanzados, así que puedes empezar aquí o desde el inicio y avanzar a tu ritmo. Esta es la lección 1 de 4.

¿Cuánto tiempo toma la lección «Iniciar python manage.py shell»?

La mayoría de las lecciones de CoddyKit toman alrededor de 5–10 minutos. Cada una es compacta e interactiva, así que avanzas constantemente y retomas exactamente por donde dejaste en la web y la app.

¿Puedo escribir y ejecutar código en esta lección de Django Academy?

Sí. Cada lección de Django Academy incluye un editor de código integrado, así que escribes y ejecutas código real directamente en tu navegador y obtienes retroalimentación instantánea de IA — sin configuración local necesaria.

Todas las lecciones de este curso

  1. Iniciar python manage.py shell
  2. Importar e inspeccionar modelos
  3. Crear y guardar objetos en tiempo real
  4. shell_plus y mejores herramientas
← Volver a Django Academy