Running Sanic locally
We finally are at the point where it is time to run Sanic—well, locally, that is. However, we also know we have been doing that all along since Chapter 2, Organizing a Project. The Sanic command-line interface (CLI) is already probably a fairly comfortable and familiar tool, but there are some things that you should know about it. Other frameworks have only development servers. Since we know that Sanic's server is meant for both development and production environments, we need to understand how these environments differ.
How does running Sanic locally differ from production?
The most common configuration change for local production is turning on debug mode. This can be accomplished in three ways, as follows:
- It could be enabled directly on the application instance. You would typically see this inside of a factory pattern when Sanic is being run programmatically from a script (as opposed to the CLI). You can directly set the value, as...