Skip to main content

a simple python web framework

Project description

Aureus

Aureus is a lightweight web application framework. It supports Model-View-Controller (MVC) architectural pattern. It is designed to make getting started quick and easy, with the ability to scale up to complex applications.

Installing

Install and update using pip:

pip install -U aureus

A Simple Example

from aureus import AUREUS

app = AUREUS()

@app.route('/', methods=['GET'])
def hello():
    return '<h1>Hello Aureus!</h1>'

app.run()
$ python3 main.py
 * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)

A MVC pattern Example

from aureus import AUREUS
from aureus.view import View, Controller


class BaseView(View):

    methods = ['GET, POST']

    def post(self, request, *args, **options):
        pass

    def get(self, request, *args, **options):
        pass

    def dispatch_request(self, request, *args, **options):

        methods_meta = {
            'GET': self.get,
            'POST': self.post,
        }

        if request.method in methods_meta:
            return methods_meta[request.method](request, *args, **options)
        else:
            return '<h1>Unknown or unsupported require method</h1>'

class Hello(BaseView):
    def get(self, request):
        return '<h1>Hello, Aureus!</h1>'


app = AUREUS()

aureus_url_map = [
    {
        'url': '/',
        'view': Hello,
        'endpoint': 'hello'
    },
]

hello_controller = Controller('hello', aureus_url_map)
app.load_controller(hello_controller)

app.run()
$ python3 main.py
 * Running on http://127.0.0.1:8080/ (Press CTRL+C to quit)

Links

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

aureus-0.0.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

aureus-0.0.3-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file aureus-0.0.3.tar.gz.

File metadata

  • Download URL: aureus-0.0.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for aureus-0.0.3.tar.gz
Algorithm Hash digest
SHA256 4f449d06db46b1611e37abc36763bfc81a729f766ef952ed72a3f624a140faa2
MD5 06e079b8686f5c08c05497daf35dcbec
BLAKE2b-256 cf0b3ae8ae929a121697b3e8b5cc330e74a1adb35c7920ed13954d7be19675b0

See more details on using hashes here.

File details

Details for the file aureus-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: aureus-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.18.4 setuptools/40.4.3 requests-toolbelt/0.8.0 tqdm/4.26.0 CPython/3.6.5

File hashes

Hashes for aureus-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b6f553c1e869689463942df3c004216f0db25a6c49962e705310b7f7767ee8d6
MD5 9015a33fb77edb98412b4da7760d988a
BLAKE2b-256 ac76c94004a44948ec42457a2487337a6734693a9376eee51df25e7e7706fb2b

See more details on using hashes here.

Supported by

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