Moya is an open source web development platform built with Python

Install with pip install moya now or download from GitHub

Moya comes with a number of built in libraries for common web application features. Libraries in Moya are self-contained; including database models, views, templates, translations, and media. While allowing customization on several levels.

Although Moya has a fairly pragmatic approach to development and tends to prefer the shortest path to seeing results, it doesn't sacrifice good practices. Logic and presentation (i.e. code and design) are kept strictly apart—so projects stay manageable even when they have grown beyond the original specification.

  • User's and Groups
  • Sign Up
  • Back-end admin site
  • Threaded Comments
  • Feedback Form
  • Blog
  • FAQ
  • Captcha
  • Thumbnails
  • Pagination
  • Rich Text Editor

Quick Start

The start command can create a customized project for you in seconds.

Boilerplate code and directories are generated automatically, to create fully working web application based on your answers to the wizard. Creating a new library is just as straight-forward.

Automatic Admin Site

Moya's Admin application can create a fully featured and highly customizable back-end for your web application.

Built In Debugger

Moya's built in debugger will help you quickly diagnose and fix any errors in your code.

Easy Templates

Moya's template language is simple and elegant, with a consistent syntax.

Mix HTML tags with a special syntax to generate data driven web pages. Find and fix bugs easily, with sophisticated error reporting, syntax highlighted code, and plain English error messages.

{% for topic in pagination.objects %}
<div class="moya-sociallinks-topic">
    <div class="topic-title">
        <a href="{% url "topic" with topic=topic.slug %}">
    <div class="topic-description">
    {% render html:topic.description %}
{% endfor %}

Simple Database Models

Design your database with a super-simple model definition.

Moya can map sophisticated database tables on to simple-to-use objects.

<model name="Question" libname="Question" xmlns="">
    <string name="slug" length="100" unique="yes"/>
    <string name="question" length="100" />
    <text name="answer" default='' />

Powerful Query Language

Query simple columns, foreign-keys, many-to-many relationships with simple readable database expressions. No SQL required *.

* Moya won't get in your way if you really want to use SQL.

<db:query model="#Character" filter="'John'" dst="johns"/>
<db:query src="johns" filter="#Character.species=='Human'" dst="human_johns"/>
<echo obj="human_johns.list" />

Define Page Content

In addition to templates, Moya supports Content—a high level description of a page. Add a widget to a page and Moya will pull in any required CSS / Javascript or external files to make it work.

<content libname="content.delete-post" template="base.html">
    <title>Delete Post</title>
    <section name="body">
        <if test="deleted">
                <html:p>Post '${deleted}' has been deleted</html:p>
            <w:button-link url="${.appurls.list}">Return to Posts</w:button-link>
            <render src="form"/>

Extendable with Python

Extend all aspects of Moya with the Python programming language.

"""A base 64 encoding to pack PKs"""
from __future__ import unicode_literals
import moya
alphabet = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789_-"
def pack(i):
    letters = ''
    while i:
        letters += alphabet[i % 64]
        i //= 64
    return letters
def unpack(s):
    i = 0
    for c in reversed(s):
        i = i * 64 + alphabet.index(c)
    return i