DEV Community

Cover image for Asok: The Modern Python Framework You Can Actually Read
Mpia
Mpia

Posted on

Asok: The Modern Python Framework You Can Actually Read

What if you could build modern web apps with Next.js-style routing, Django-level features, and SvelteKit-like reactivity... but with zero dependencies and code you can actually read and understand?

Meet Asok — a full-stack Python framework that challenges everything you thought you knew about web development.


🎯 The Identity: Modern Minimalism

Asok isn't just another minimalist framework. It's a batteries-included, modern framework that happens to have zero external dependencies.

While most frameworks force you to choose between:

  • Bloated giants with thousands of dependencies (Django, Rails)
  • Empty shells that require assembling 20+ libraries (Flask, Sinatra)
  • Complex toolchains with build steps and transpilers (Next.js, SvelteKit)

Asok gives you a third path: A cohesive, modern framework built entirely on Python's standard library.


💎 Zero Dependencies. Maximum Productivity.

pip install asok
asok create my-app
cd my-app
asok dev
Enter fullscreen mode Exit fullscreen mode

That's it. No npm install. No vendor folders. No hidden complexity.

Asok is built on ~11,000 lines of pure Python — small enough to read in an afternoon, powerful enough to ship production apps.

What you get out of the box:

  • File-based Routing (src/pages/ → URLs, just like Next.js)
  • 🔐 Built-in Auth (Sessions, CSRF, password hashing)
  • 🗄️ AsokDB ORM (Relations, migrations, automatic validation)
  • 🎨 Admin Panel (100% auto-generated, fully customizable)
  • 🔄 Live Components (Real-time UI via WebSockets — no JS framework needed)
  • 🌍 i18n & Localization (Built-in translation engine)
  • 📧 Email Support (SMTP integration included)
  • Task Scheduler (Cron-like background jobs)
  • 🚀 Production Ready (WSGI/Gunicorn compatible, SELinux support)

🛣️ File-Based Routing: Because Your URLs Should Be Obvious

Forget decorators. Forget urls.py. Your folder structure is your routing.

src/pages/
├── page.html              → /
├── about/page.html        → /about
├── blog/[slug]/page.py    → /blog/my-post
└── api/users/[id]/page.py → /api/users/123
Enter fullscreen mode Exit fullscreen mode

Dynamic routes? Built-in.

# src/pages/shop/[category]/page.py
from asok import Request

def render(request: Request):
    category = request.params.get('category')
    return f"Shopping in: {category}"
Enter fullscreen mode Exit fullscreen mode

🧠 The Philosophy: Readable > Magical

Most frameworks hide their complexity. Asok exposes it — in the best way possible.

  • No black boxes. Every feature is implemented in readable Python.
  • No magic imports. You can trace every function call.
  • No hidden runtime. What you write is what runs.

Want to know how auth works? Read asok/session.py (300 lines).
Curious about the ORM? Check asok/orm.py (800 lines).
Need to understand routing? Open asok/core.py.

This is code you can trust — because you can actually read it.


🔥 Real-Time by Default

While other frameworks require Socket.IO, Django Channels, or complex WebSocket setups, Asok has native Live Components:

# src/components/Counter.py
from asok import Component
from asok.component import exposed

class Counter(Component):
    count = 0

    @exposed
    def increment(self):
        self.count += 1

    def render(self):
        return f"""
        <div>
            <p>Count: {self.count}</p>
            <button ws-click="increment">+1</button>
        </div>
        """
Enter fullscreen mode Exit fullscreen mode
<!-- Your template -->
<div class="counter">
  <p>Count: {{ count }}</p>
  <button ws-click="increment">+1</button>
</div>
Enter fullscreen mode Exit fullscreen mode

That's it. Asok handles WebSocket connections, state synchronization, and UI updates automatically.


🗄️ AsokDB: The ORM That Gets Out of Your Way

No migrations mess. No N+1 queries. Just clean, obvious data models.

from asok import Model, Field

class User(Model):
    name = Field.String()
    posts = Relation.HasMany('Post')
    profile = Relation.HasOne('Profile')
    roles = Relation.BelongsToMany('Role')

class Post(Model):
    author_id = Field.ForeignKey(lambda: User)
    author = Relation.BelongsTo('User')
Enter fullscreen mode Exit fullscreen mode

Relations, validation, and automatic table creation — all included.


⚖️ Asok vs. The Giants

Feature Asok Flask Django
Dependencies 0 ~6 ~3
Lines of Code ~11,000 ~5,000 (core only) ~270,000+
Routing File-based Decorators urls.py
Admin Panel Auto-generated Requires Flask-Admin Heavy, legacy
Real-time Native WebSockets Requires extensions Django Channels
Philosophy Modern + Batteries Micro Mega

🚀 Production Ready, Zero Hassle

Asok is WSGI compatible and production-tested:

gunicorn wsgi:app --workers 4
Enter fullscreen mode Exit fullscreen mode

Special support for RHEL/AlmaLinux (SELinux) environments.
Built-in rate limiting, CSRF protection, and secure session handling.


🌍 Join the Revolution

Asok is for developers who believe:

  • Less is more — but "batteries included" is non-negotiable
  • Simplicity scales — complexity is a bug, not a feature
  • You should understand your tools — frameworks should be readable

Get Started:


💡 The Bottom Line

Django is a 15-year-old monolith.
Flask is an empty canvas that requires assembly.
Asok is a modern, complete framework you can actually understand.

~11,000 lines. Zero dependencies. Infinite possibilities.

Stop assembling. Start creating.


Python #WebDev #OpenSource #Minimalism #AsokFramework #ModernDevelopment #ZeroDependencies #CleanCode

Top comments (0)