mindcurrent / djanky-django

Daniel's Janky Attempt at a Django RESTful API Server
0 stars 1 forks source link

Explore the (CLI-invoked) django shell #11

Open dpcunningham opened 4 years ago

dpcunningham commented 4 years ago

Per the guide, Playing with the API, we should be able to:

hop into the interactive Python shell and play around with the free API Django gives you.

To invoke the Python shell, use this command: $ python3 manage.py shell

We’re using this instead of simply typing “python”, because manage.py sets the DJANGO_SETTINGS_MODULE environment variable, which gives Django the Python import path to your mysite/settings.py file.

This is an interactive exploration, thus leaving no real artifacts for process definition.

$  python3 manage.py shell

...while (per the tutorial) in a parallel terminal session, we modify models.py

$ vi polls/models.py