Skip to main content

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

Release files for irails 1.6.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for irails 1.6.4
File Size Uploaded
irails-1.6.4.tar.gz 1.0 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for irails 1.6.4
File Interpreter ABI Platform
irails-1.6.4-py3-none-any.whl Python 3 none any Details

Total release size: 2.1 MB

Release files / irails-1.6.4.tar.gz

Download URL irails-1.6.4.tar.gz
Size 1.0 MB
Tags Source
SHA-256 checksum
How to use checksums
82bb7b64f662464662300c70935ee61fd00e5fde8f6fc8111cf41c27892e1b2b
BLAKE2b-256 checksum
How to use checksums
24b06f552cf4880a5b14b78aeada7b2ccdd45949cba9f7e573a7eb7ea7cf8085
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release files / irails-1.6.4-py3-none-any.whl

Download URL irails-1.6.4-py3-none-any.whl
Size 1.1 MB
Tags Python 3
SHA-256 checksum
How to use checksums
3e237fbe6d5d8e39f6a490ef629313aec48cca2d54b80ea7883dd28ff9048b67
BLAKE2b-256 checksum
How to use checksums
a2b73514bc7210be269c29e82906e346fee19c209dc17feb3b99c973a3905177
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.11

Release history Release notifications | RSS feed

This release

1.6.4 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page