Skip to main content

Simple and elegant use of FastApi in MVC mode

Project description

irails

A mvc framework used FastApi Simple and elegant use of FastApi in MVC mode

Online Docs

Welcome to IRAILS

IRAILS is not just an ordinary imitation of Ruby on rails, but based on the characteristics of the Python language itself, combined with rich Python class libraries, it refuses to create wheels repeatedly, and can achieve web development with minimal code and configuration, making Python web development fast and powerful, and can be easily deployed on various platforms. The design concept of IRails refers to some RORs, but it has its own soul. It does not pursue the ultimate configuration and development, but rather appropriate configuration and development. Currently, it is in a preview version and will continue to improve in the future.

Installation

  • pip install irails - install irails

Commands

  • irails project [project-name(dir-name)] - Create a new irails project.
  • irails app [app-name(choose or input apps dir)] - Example: irails app admissions Create a new irails app.
  • irails run [--host host] [--port port] - Run project visit on http://127.0.0.1:8000>.
  • irails controller [actions...] - generate a controller with given actions(if no given,defalut is index).
  • irails model [columns...] - generate a model(and model's service and tests) with given columns(if no given,defalut is id).

Project layout

 
    |   main.py
    +---apps                                ## Apps container (A project can have multiple containers)
    |   +---admissions                      ## App dir (An application container can have multiple applications)
    |   |   |   __init__.py                 
    |   |   +---controllers                 ## Controller files
    |   |   |   |   home_controller.py      ## Controller class file,it's look like `class HomeController`
    |   |   |   |   __init__.py
    |   |   +---locales                     ## I18n locales dir,use command `apps/app:$ iralis i18n gettext` will auto generate items
    |   |   +---models                      ## Database models files(if you use some database support)
    |   |   |       __init__.py
    |   |   +---services                    ## Module for business logic processing
    |   |   +---tests                       ## Unit testting
    |   |   +---views                       ## Static view files (use `Jinja2` Template)
    |   |   |   |   layout.html
    |   |   |   |
    |   |   |   +---home                    ## The controller action's static file(name is same to the controller's class name)
    |   |   |   |       home.css            
    |   |   |   |       home.html           ## Static file corresponding to action(name is same to the controller's method name)
    |   |   |---manifest.yaml               ## The app manifest for each app
    +---configs                             ## Project configure dir
    |       alembic.ini                     ## Alembic configure file (Generally, there is no need to change, used the database migration)
    |       casbin-adapter.csv              ## Casbin auth module config adapter file()
    |       casbin-model.conf               ## Casbin auth config model
    |       database.yaml                   ## Configure for database support
    |       general.yaml                    ## General configures
    |       session.yaml                    ## Session configures
    |
    +---data
    |   +---alembic
    |   |   \---versions
    |   \---db
    |
    +---public                              ## Public dir (will mounted to the '/public' url)
    |   |   error_404.html                  ## Error page ...
    |   |   error_500.html
    |
    +---uploads                             ## Others dir(if your need or not)

Extras commands

  • irails i18n gettext --generate i18n in irails app dir
  • irails shell --run python interpreter with buildin support contexts
  • irails test --run project tests
  • irails migrate --run database migrations

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

irails-1.6.4.tar.gz (1.0 MB view details)

Uploaded Source

Built Distribution

irails-1.6.4-py3-none-any.whl (1.1 MB view details)

Uploaded Python 3

File details

Details for the file irails-1.6.4.tar.gz.

File metadata

  • Download URL: irails-1.6.4.tar.gz
  • Upload date:
  • Size: 1.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for irails-1.6.4.tar.gz
Algorithm Hash digest
SHA256 82bb7b64f662464662300c70935ee61fd00e5fde8f6fc8111cf41c27892e1b2b
MD5 e2e5fd896e19916b04496a1aa6acda50
BLAKE2b-256 24b06f552cf4880a5b14b78aeada7b2ccdd45949cba9f7e573a7eb7ea7cf8085

See more details on using hashes here.

File details

Details for the file irails-1.6.4-py3-none-any.whl.

File metadata

  • Download URL: irails-1.6.4-py3-none-any.whl
  • Upload date:
  • Size: 1.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.11

File hashes

Hashes for irails-1.6.4-py3-none-any.whl
Algorithm Hash digest
SHA256 3e237fbe6d5d8e39f6a490ef629313aec48cca2d54b80ea7883dd28ff9048b67
MD5 64f1e3ba269e8eb3416eaf1dc1134213
BLAKE2b-256 a2b73514bc7210be269c29e82906e346fee19c209dc17feb3b99c973a3905177

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