Web Development

Build web apps and services with tested examples: HTTP, REST APIs, servers, routing, and templating across the Python and Groovy tutorials.

Python Mocking & Patching with unittest.mock

A Python mock is a stand-in object you drop into a test so it never touches the real API (Application Programming Interface), database, or email server. This post walks through the patterns that make unittest.mock click: the @patch decorator, MagicMock, side_effect, return_value, and the one rule about WHERE to patch that trips up almost everyone. “A test that talks to a database is not a unit test.” Michael Feathers, Working Effectively with Legacy Code Last Updated: July 2026 | Tested ... Read More

Python: Virtual Environments & Dependency Management

A Python virtual environment, or venv for short, gives every project its own private box of packages, so two projects can need two different versions of the same library and neither one breaks. This post shows you why virtual environments exist, how activation quietly changes your PATH, how to pin dependencies in requirements.txt, and how to stop one project from ever poisoning another again. “The Python development world is filled with smart engineers, but dependency management can humble even the ... Read More

Python: pip vs Poetry vs uv vs conda, Package Managers Compared

Choosing a Python package manager really comes down to four big contenders: pip, Poetry, uv, and conda. This practical comparison hands you a decision flowchart, a feature matrix, honest speed guidance, and short migration notes so you can pick the right tool for your project in about 30 seconds. “Let us change our traditional attitude to the construction of programs: instead of imagining that our main task is to instruct a computer what to do, let us concentrate on explaining ... Read More