Jam.py (web framework)#Example

{{short description|Python web framework}}

{{Infobox software

| name = Jam.py

| screenshot = File:Screenshot from 2024-05-23 09-42-54.png

| caption = Screenshot of Parameters, with the visual form editor being used to create an application

| released = {{Start date and age|2015|07|01}}

| latest release version = {{wikidata|property|reference|edit|P348}}

| latest release date = {{start date and age|{{wikidata|qualifier|P348|P577}}}}

| genre = Web framework

| license = 3-clause BSD

| website = {{URL|https://jampyapplicationbuilder.com/}}

| repo = https://github.com/jam-py-v5/jam-py

| programming language = Python, JavaScript

| platform = Cross-platform

| author = Andrew Yushev

}}

Jam.py is free and open-source low-code/no-code "full stack" WSGI rapid application development framework for the JavaScript and Python programming language.{{Cite web|url=https://wiki.python.org/moin/WebFrameworks/|title=WebFrameworks - Python Wiki|website=wiki.python.org}}

Jam.py version 5.x is a Single-page, [[Event-driven architecture|event driven

]] low-code development platform for database-driven business web applications, based on DRY principle, with emphasis on CRUD.

It is designed to automatically create JavaScript web forms from the underlying database tables, although a form can be created manually if required. The existing database tables can be imported into Jam.py to create the forms and reports. The database views are not supported for import.

It offers a built-in web server, Application Builder and database access for third-party databases.

Jam.py version 7.x supports routing within the Single-page. It does not support URL mapping.

Features

Distinctive features

= Built-in Application Builder =

All development, maintenance and remote database administration can be performed via Builder interface. The most distinctive feature is the Client and Server Module. The Server Module enables the Python code for business logic, executed as a server-side session. The Client Module executes the JavaScript code within a browser. It is possible to exchange data between the two.

[https://www.linux-magazine.com/Issues/2020/241/Jam.py Building a database front end with Jam.py]

Application Builder is strongly influenced by Delphi visual designer.[https://www.webprecis.com/best-frameworks-for-web-design Best Frameworks for Web Design]

= Application Builder Client Module =

The following JavaScript code shows a simple web page that displays "Hello World!" when visited:

task.create_menu($("#menu"), $("#content"), {

splash_screen: '

Hello World!

',

view_first: true

});

The above code resides in Task/Client Module(s) within the Application Builder. The task function can be accessed globally.

= Application Builder Server Module =

The Python libraries can be imported within the Task/Server Module(s):

import smtplib

def send_email():

# code that sends email

The above code imports smtplib library, which might be used to send emails. The defined functions can be accessed globally.

=== Database migrations ===

Jam.py supports database migration and data import from one supported database to another.

The below code in the Task/Server Module will import data from SQLite to application database:

from jam.db.db_modules import SQLITE

def on_created(task):

task.copy_database(SQLITE, 'demo.sqlite')

Limitations:

  • The SQLite database can not be imported into the application database which has foreign keys.[https://jampyapplicationbuilder.com/docs/how_to/how_to_migrate_to_another_database.html How to migrate to another database]

PythonAnywhere

PythonAnywhere Python 3.x deployment is supported{{Cite web|url=https://github.com/pythonanywhere/help_pages/blob/master/articles/Jampy.md|title=pythonanywhere/help_pages|website=GitHub|date=11 October 2021}}

Notes

{{Reflist|group=Note}}

References

{{Reflist}}

See also