Python web framework JustPy – interactive websites without JavaScript
JustPy is a new Python web framework that requires no front-end programming and is meant to be an alternative to JavaScript for creating interactive websites. The project is still in its early stages of development, yet offers an extensive documentation and tutorials, and comes with support for pandas, Matplotlib and more.
Thanks for visiting our article Python web framework JustPy – interactive websites without JavaScript. Please share it with kind.
The very first public release of the high-level Python web framework JustPy has been published to GitHub. JustPy is object-oriented, component-based, and does not distinguish between front-end and back-end programming.
As the framework’s developer Eliezer Mintz describes, “All programming is done on the back-end allowing a simpler, more productive, and more Pythonic web development experience.” He further hopes that “JustPy will enable teaching web development in introductory Python courses by reducing the complexity of web development.”
So, let’s see how to use JustPy and how it integrates with other Python tools.
The documentation shows how to install JustPy and its dependencies, after creating a directory and creating and activating the virtual environment jp:
Then, in the jptutorial directory, you can create the file test.py (another file name may be chosen instead) that contains the following code:
For more details, see the official website, the GitHub repo, or follow JustPy on Twitter.
As the framework’s developer Eliezer Mintz describes, “All programming is done on the back-end allowing a simpler, more productive, and more Pythonic web development experience.” He further hopes that “JustPy will enable teaching web development in introductory Python courses by reducing the complexity of web development.”
So, let’s see how to use JustPy and how it integrates with other Python tools.
First steps with JustPy
JustPy requires Python 3.6 or higher, and it is recommended to run the tutorial programs in a virtual environment so as not to affect the system-wide Python interpreter.The documentation shows how to install JustPy and its dependencies, after creating a directory and creating and activating the virtual environment jp:
$ mkdir jptutorial $ cd jptutorial $ python3 -m venv jp $ source jp/bin/activate (jp) $ pip install justpyOn Windows, use
jp\Scripts\activate
instead of source jp/bin/activate
to glowing the virtual environment.Then, in the jptutorial directory, you can create the file test.py (another file name may be chosen instead) that contains the following code:
import justpy as jp def hello_world(): wp = jp.WebPage() jp.Hello(a=wp) return wp jp.justpy(hello_world)Now, run the program by entering the command
$ python3 test.py
and go to http://127.0.0.1:8000 or http://localhost:8000/ in your browser – and you should see “Hello!”. When you click on it multiple times, the number of clicks should be displayed.Support for Matplotlib, pandas and more
In JustPy, visualizations with the Python library Matplotlib and the JavaScript charting library Highcharts are supported. Additionally, JustPy has a pandas extension on board for creating interactive charts and grids.For more details, see the official website, the GitHub repo, or follow JustPy on Twitter.
Sincery All Tips collection
SRC: https://jaxenter.com/python-web-framework-justpy-168239.html
powered by Blogger News Poster
0 Response to "Python web framework JustPy – interactive websites without JavaScript"
Post a Comment