Skip to main content

Web framework for pythoneers

Project description

Aquilo Framework

A, Flutter & Django inspired, web development framework for python.

Build beautiful and responsive websites without ever needing to touch HTML, CSS, or JavaScript. With Aquilo you can build a website entirely in python, and it will be blazing fast.

You can choose to either host your website any cloud provider that supports WSGI specifications. Or you can build the HTML and static files for your website and host them wherever you want.

Installation

Aquilo is still under heavy development and is not available on Pypi yet, so you'll need to install it manually.

First you'll need to build the Aquilo package.

$ git clone https://github.com/KeloDraken/Aquilo
$ cd Aquilo
$ virtualenv venv
$ source venv/bin/activate
$ pip install -r requirements.txt
$ python -m build

Then you can install it in your project via pip

$ mkdir <project_name>
$ cd <project_name>
$ virtualenv venv
$ source venv/bin/activate
$ pip install <path_to_aquilo_package>

Usage

Since Aquilo is heavily influenced by Django, some commands will be familiar.

For example, if you want to create a new project, you can use the aquilo startproject <project_name> command.

$ aquilo startproject my_project

This will create a new project in the current directory.

The commands are not the only things I borrowed from Django. The initial project structure is also based on Django.

For example, when you create an Aquilo app there'll be a file called manage.py in the root of the project which will contain the commands you can use. You will use this file to handle the administrative tasks while creating your website, such as creating new apps, running the development server, and, eventually, it will also be used to create and run tests, creating and executing database migrations.

Development server
To start the development server, run

$ python manage.py runserver

Apps
Like Django, Aquilo is also built on the concept of apps. An app is python package that contains the code for a specific part of the website. For example, the home page of the website is contained in an app called home.

To create an app, run

$ python manage.py startapp <app_name>

This will generate a new app in the <project_name>/apps directory. You will need to add the app name to the APPS list entry in the <project_name>/config/settings.py file.

from pathlib import Path

BASE_DIR = Path(__file__).resolve().parent.parent.parent

DEBUG = True

APPS = [
    "home",
    "<app_name>",
]

The order of the APPS list is important. The first app in the list will be the home app. Only 1 page is allowed to be the home page.

A new app will contain a pages.py file, the functions defined in file will be used to generate the HTML for the pages. The default home page inside the home app will look like this:

from aquilo import build, div, h1


def page_home():
    root = div(h1("Hello World!"))
    return build(root, title="Hello World!")

You'll notice that the function name has the prefix page_. All pages must have this prefix, or else they won't be recognised as pages.

Aquilo uses a style I first saw in the Flutter Framework, it uses a tree-like structure to create the markup. You keep adding children to the root div class to create the markup.

The build function is used to create the markup. It takes the root element which needs to be a div and uses it to generate the HTML markup which is the served.

The HTML
The HTML generated by Aquilo is written into a single HTML file called output.html which will the page that will served. This file's content will always be different, depending on the page you are requesting.

Bugs & Roadmap

  • Rewrite WSGI implementation (I tried deploying a test site to PythonAnywhere, but it didn't work)
  • Add more HTML tags to the parser
  • Add styling capabilities for easy customisation
  • Make development server watch the project for changes and reload automatically
  • Build a UI component library for Aquilo based on Material Design
  • Add indepth documentation in docstrings for all the functions
  • Build my portfolio website with Aquilo
  • Create a VSCode extension for Aquilo to help make the code more readable (I've found that it be a bit hard navigate when you have deeply nested elements)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

aquilo-0.0.1.tar.gz (24.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aquilo-0.0.1-py3-none-any.whl (25.5 kB view details)

Uploaded Python 3

File details

Details for the file aquilo-0.0.1.tar.gz.

File metadata

  • Download URL: aquilo-0.0.1.tar.gz
  • Upload date:
  • Size: 24.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for aquilo-0.0.1.tar.gz
Algorithm Hash digest
SHA256 a73ee6bef37ff5eff978d692d61fc93033cc501af7bbdf15a62784fe0d599838
MD5 160b02c01a7bd83830d247984e23b621
BLAKE2b-256 ddfc52c43ce79bca65bffaf223c720fc4cfee6827ac127d801958013a5666fbc

See more details on using hashes here.

File details

Details for the file aquilo-0.0.1-py3-none-any.whl.

File metadata

  • Download URL: aquilo-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 25.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for aquilo-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ec7b34d22d529fac1ba8db299f8e7bf2cc7031e593d7e6d79c95126679f5135d
MD5 f122f2b5764c9b1aa904da46e6b2c667
BLAKE2b-256 0a408d07eb9c463c48f9195bf6209e57cadca5909f8394fb7187aee97e06224d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page