Server Applications in Python, Django, Flask and FastAPI
R. S. Bukharev
- Programming
- Python
- Backend
The path of server-side development in Python, from sockets and protocols to architecture and launch on a server. Django, Flask and FastAPI are covered through real projects: a CRM system, a Telegram bot with server-side logic, a REST API for a mobile app and a WebSocket chat.
Separate chapters cover caching and scaling, Docker and Kubernetes, PostgreSQL, MySQL, SQLite and MongoDB, and security: password hashing, JWT and OAuth 2.0, protection against SQL injection, XSS and CSRF, TLS.
Key ideas
- Choose the framework for the task: Django for an admin panel and “batteries included”, Flask for small services, FastAPI for async APIs.
- Under every framework there’s HTTP and sockets: understanding the protocol saves hours of debugging.
- Security is built in from the start: passwords only as hashes, API keys outside the code, user input through query parameters.
- Caching and horizontal scaling are cheaper than rewriting a service for load.
How I apply it
I write this site’s API and bot backends in FastAPI, and use Django when a client needs a ready-made admin panel.
Where and how I applied it

Demo · Python backend · webhooks → amoCRM and Bitrix24
Lead integration hub
A lead hub on async FastAPI: webhooks from twelve sources, each with its own protection — an HMAC signature, a token or a confirmation string.
More on the shelf
Reading
Hands-On APIs for AI and Data Science
Ryan Day
A practical book on building an API for data and connecting AI to it. The running project is a FastAPI service with a database and documentation, then an SDK for it, using the API in analytics and, finally, LangChain agents that call the API themselves.
AI and agentsPythonAPIApplied in 3 projectsReading
Prompt Engineering for LLMs
John Berryman, Albert Ziegler
The authors are engineers who built GitHub Copilot. The book isn’t about “magic phrases” but about how to build an application around a model: how an LLM sees text, how to assemble context for it from user data, how conversational agents with tools and multi-step workflows work, and how to evaluate answer quality.
AI and agentsLLMPrompt engineeringApplied in 3 projects


