QR Print Station runs as a lightweight Python HTTP server that binds to every network interface on your machine. Once it is up, any customer on the same Wi-Fi network can scan the printed QR code, upload their documents, and set their print options — no app install required. This guide walks through the complete local-network setup from a fresh clone to a running server.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/hxmz-axfn07/qr-printing-sfw/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before you begin, make sure the following are available on the machine that will run the server:- Python 3.11 or newer —
python3 --version - MySQL 5.7+ or MariaDB 10.3+ — the server uses PyMySQL with the
utf8mb4charset - pip — bundled with every modern Python installation
Installation
Create and activate a virtual environment
Isolate dependencies from your system Python installation:
Install dependencies
All three runtime packages are pinned in This installs:
requirements.txt:qrcode[pil]==8.2— QR code generation with Pillow image supportPyMySQL==1.1.1— pure-Python MySQL driverPyYAML==6.0.2—config.ymlparsing
Create the MySQL database and user
The bundled SQL file creates the See the Database page for a full description of the schema and auto-migration behaviour.
qr_printing database, the qr_print_user account, and all four tables in one command:Configure the environment file
Copy the example file and edit the values:Open Key values to change before going live:
.env in your editor and set at minimum:| Variable | What to set |
|---|---|
ADMIN_TOKEN | A long, random secret string — this becomes part of the admin dashboard URL |
MYSQL_PASSWORD | The password you set for qr_print_user in MySQL |
PORT | (Optional) Change from 8000 if that port is already in use |
Startup Output
A successful start prints the local IP, all access URLs, and the path to the generated QR PNG:8.8.8.8 — it reflects whichever network interface routes outbound traffic, which is normally the local network adapter.
QR Code
On every startup the server writesqr-codes/upload.png — a PNG-encoded QR code that encodes the customer upload URL. Print this image or display it on a screen at the counter. Customers scan it with any smartphone camera app and are taken directly to the upload page.
The QR code stays up-to-date automatically. A background thread wakes up every QR_REFRESH_SECONDS seconds (default 5) and calls get_upload_url(). It compares the result against the URL stored in qr-codes/.last_url. If the URL has changed — for example because PUBLIC_URL was updated in .env — or if the PNG file is missing, the thread regenerates qr-codes/upload.png immediately. You never need to restart the server to refresh the QR code.
Network Access
The server callsThreadingHTTPServer with the bind address 0.0.0.0, which means it accepts connections on every available network interface. Any device connected to the same local network can open the upload page using the IP address shown in the startup output — for example http://192.168.1.100:8000/upload.
Firewall Note
If the host machine runs a software firewall (such asufw, firewalld, or the Windows Defender firewall), you must allow inbound TCP connections on the configured PORT (default 8000). For example, on Ubuntu with ufw:
PORT in .env.