Drafter is an educational web development library designed for introductory Python courses. Students build interactive websites using familiar Python concepts such as functions, dataclasses, and lists, without needing to learn a separate web programming stack first.
New to Drafter? The Start guide takes you from installation to a working interactive application, then introduces Drafter’s debugger and runtime model.
You can also:
- Build guided projects including a virtual pet, story maker, and quiz game.
- Browse examples of complete Drafter applications.
- Look up components such as buttons, forms, tables, images, maps, cameras, and audio.
- Learn how to publish a project with GitHub Pages.
- Explore the full Drafter documentation, including help, reference material, and guides for building your own project.
Why Drafter?
Drafter was created for students who know some Python and want to build something they can share with other people.
A Drafter application uses the same programming ideas students encounter in an introductory Python course:
- Routes are functions. Each page is produced by a Python function.
- State is explicit. Application data can be represented with a Python dataclass.
- Applications are testable. Routes can be called directly from tests, so web development reinforces ordinary function testing.
- Web interfaces are built from Python components. Students can add buttons, text boxes, images, tables, forms, maps, media, and other interactive elements without first learning HTML or JavaScript.
- Projects can be shared. Drafter applications can be published as static sites using GitHub Pages.
Drafter deliberately simplifies web development for an introductory course. It does not provide a backend, database, user accounts, or a security boundary. The application runs in the visitor’s browser. For a fuller discussion of the design choices and their tradeoffs, see Why Drafter.
Teaching with Drafter
Drafter is intended to fit into an introductory Python course after students have worked with functions, dataclasses, lists, and loops. The instructor documentation includes guidance for introducing Drafter, structuring assignments, and helping students move from guided exercises to independent projects.
- Why Drafter? explains the pedagogical goals and compares Drafter with alternatives such as Flask, Streamlit, and raw web development.
- Lesson plans provide materials for teaching the first Drafter application, forms and state, and testing.
- Project ideas provide starting points for student assignments and larger projects.
- Teaching with Drafter collects the full instructor documentation.
Drafter Development
Drafter is open source. Source code, bug reports, feature requests, and discussions are hosted on GitHub.
About Drafter
Drafter was created to make interactive application development accessible within an introductory Python course.
- Austin Cory Bart (acbart.com)
- Nazim Karaca