Project: DinoWebServe
Most modern web frameworks are overpowered for small tasks.
Sometimes I just want to:
- Serve static files quickly
- Add a tiny bit of Python logic inside HTML
- Reuse an old PHP script
- And not deal with routing, middleware, or deployment
So I built DinoWebServe, a minimal web server that can do all that.
Motivation
Why not just use Flask, Django, or PHP alone?
- Flask/Django are great — but for a quick local tool, they feel heavy.
- PHP alone can’t handle Python logic directly.
- Mixing both languages usually requires reverse proxies, separate servers, or templating hacks.
I wanted something that works immediately, is simple, and easy to hack.
Architecture Overview
- Python backend: powered by Flask, handles dynamic
.pyspages - PHP support: via
php-cgi, works seamlessly alongside Python - Sandboxed execution: Python scripts run in a controlled environment
- Static file serving: Everything under
WWW/is exposed - Logging: Every request is logged to
log/in JSON format
Example folder structure:
DinoWebServe/
├── DinoWebServe.py # main server
├── config/
│ ├── config.cfg # configuration
│ └── function.py # utility functions
├── WWW/ # web root
├── PHP/ # php-cgi binary
└── log/ # request logs
Key Features
1. Python Inside HTML
Embed Python directly in HTML:
<python>
echo("Current time: " + str(datetime.datetime.now()))
echo("Your IP: " + remote_addr())
</python>
No templates, no Jinja — pure Python execution.
2. PHP + Python Mixed Pages (.pp)
Re-use PHP and add Python logic:
<?php
echo "<h1>PHP output</h1>";
?>
<python>
echo("<p>Python timestamp: " + str(time.time()) + "</p>")
</python>
This is handy for projects with legacy PHP pages.
3. Quick Setup
Run:
python DinoWebServe.py
Open:
http://localhost
Done. No configuration headache.
4. Built-in Logging & Monitoring
Logs every request:
{
"timestamp": "2025-01-09T10:30:45",
"ip": "127.0.0.1",
"method": "GET",
"path": "/"
}
Helps debugging and auditing small apps.
Trade-offs
- Not production-ready: It’s lightweight by design
- Limited sandboxing: Security is reasonable for dev/testing but not enterprise
- Mixing PHP + Python: Can get messy if overused
I consciously chose simplicity over safety and performance for personal projects and learning.
Why It’s Fun
- Experiment with dynamic Python logic in HTML
- Mix Python with PHP without complex setups
- Learn server design in a minimal, understandable way
- Rapid prototyping for small tools, testing, or teaching
Design Philosophy
- Control > Convention: I want to see and modify everything
- Minimalism > Features: Only implement what’s needed
- Readable Logs: Every request is transparent and inspectable
- Hackability: Easy to fork, tweak, and extend
Final Thoughts
Sometimes, building a smaller, hackable tool teaches more than using a massive framework.
DinoWebServe is probably a bad idea for production.
But it’s fun, surprisingly useful, and you can actually understand everything under the hood.


























