Python tutorials
Every Python tutorial on TechPurAI, in one place — hands-on and written to be followed along with.
Installing Django REST Framework and setting up the project
Install DRF, register it in INSTALLED_APPS, and create the Task model this 22-part series builds a real API around.
Setting Up a Real Python AI Project
The real, reusable project setup every tutorial in this series builds on — environment, dependencies, secure API key handling, and a shared client module — done once, correctly, instead of repeated in every part.
Starting a Django project: installation and project structure
Install Django, create a project with django-admin, and understand what every generated file actually does — part 1 of a 22-part series building a real blog application.
Planning a scraper: picking a target, and reading its robots.txt
Before writing a line of code — choosing a site you're allowed to scrape, reading robots.txt, and setting up the project this series builds across six parts.
Django template views: turning a URL into rendered HTML
Connect a URL to a view, render a template with context data, and move from a function-based view to Django's TemplateView — including template inheritance done right.
The Python Requests Library: GET, POST, and the Footguns Nobody Warns You About
GET, POST, timeouts, sessions, retries, and error handling with Python's requests library — plus the default that silently hangs production code.
Python compiler vs. interpreter: what actually happens when you run a .py file
Python does have a compiler — most people never see it. Trace source to bytecode with py_compile and dis, and see why that two-step process actually matters.
BeautifulSoup basics: pulling structured data out of messy HTML
Parse real-world HTML with BeautifulSoup — select by tag, class, and CSS selector, handle missing elements, and pair it with requests to scrape a page.
Exception handling in Python, done properly
try, except, else, and finally — what each block is actually for, and the two mistakes that turn error handling into a liability instead of a safety net.
Installing Python and your first script
Get a working Python install, a project folder, and a virtual environment — then run the first version of the expense tracker you'll build across this series.
Virtual environments and pip, explained
Why every Python project needs its own environment, what pip actually does, and how to pin dependencies so your project still installs next year.
Python type hints that actually catch bugs
Add type hints to real code, run mypy to find the mistakes they expose, and learn which annotations earn their keep — and which are noise.
Python for data analysis: pandas basics
Load, clean, filter, merge, and reshape a real dataset using pandas — no prior data experience needed.