kuorra
Introduction
Kuorra is a WebApp Model, it's based on MVC Pattern, and use Web.py like Microframework.
Use Kuorra to create a MVC skeleton for work with Web.py, MySQL and Heroku App.
Kuorra Model
Install Kuorra
- In a terminal write python -m pip install kuorra, this download all requirements packages.
Upgrade Kuorra
- In a terminal write python -m pip install kuorra ---upgrade, this update all requirements packages.
Functions
-
Script for create a demo DB.
-
Config one DB conection.
-
Create a products Controller.
- Index [index.py]
- View [view.py]
- Edit [edit.py]
- Delete [delete.py]
- Insert [insert.py]
-
Create a products Model. [model_products.py]
- get_all_products
- get_products
- delete_products
- insert_products
- edit_products
-
Create a products Views:
- Index [index.html]
- View [view.html]
- Edit [edit.html]
- Delete [delete.html]
- Insert [insert.html]
- Master [master.html] Web Template
-
Create a products API. [api_products.py]
- GET all products (GET)
- GET one product (GET id)
- INSERT one product (PUT id, fields)
- DELETE one product (DELETE id)
- UPDATE one product (UPDATE id, fields)
- Active a SSL connection
How to Use Kuorra
Create new project
kuorra new project_name
- Acme Store MVC Skeleton
Config new project
-
The new project have a demo database called acme_store_mvc, with a products table.
-
The database script is written in the file data + schema.sql.
- Connect to MySQL server using mysql cli, mysql workbench or any other application.
- Execute the script schema.sql for create the DB.
- Products table
-
In the file application + models + model_products.py modify the connection parameters
- db_host = 'localhost'
- db_name = 'acme_store_mvc'
- db_user = 'your user name'
- db_pw = 'your password'
Deploy project
- Into de folder where is the app.py file execute kuorra dep for deploy de WebApp.
kuorra dep
- For stop de server press Ctrl + C.