Django comes with a lightweight server that allows you to serve your project on your local machine at http://localhost:8000. This is a great way to test and troubleshoot your application code.
Your local server isn't exposed to the real Internet, though, so your Django project can't receive requests from an external source, such as a Twilio webhook.
For development purposes, you may need to test that your app code properly handles requests from external sources. To do that, you must expose your app to the Internet.
What is ngrok?
The ngrok utility generates public URLs that map to your local server, enabling you to test how your development code handles requests from external sources. Read more about ngrok and how it works in the official documentation.
All you need for this tutorial is an existing Django project running on Python 3.
Ask just about any programmer why they like to write code, and I’ll bet you a giant slice of chocolate cake that every single person will give at least one of these answers:
- “I love making things!”
- “I love learning how things work!”
- “I love solving problems!”
Of course, this isn’t an exhaustive list of the reasons why people like to write code, but the exclamations in this list have reliably and recurrently come up when I get into conversations with fellow developers. Often, these developers will tell me that not only do they love making things, love learning how things work, or love solving problems, they have actually always enjoyed these things, even in their childhood.
This unique collection of interests — building, learning, solving — is the longstanding core of my identity.
How it started
In elementary school, Mrs. Elliott was my daycare provider and watched over me …