Almost every single day technology advances to new depths. New frameworks, libraries, design patterns, and programming ideas are released to keep up with the innovation rate in other sectors. Social-coding platforms such as Livecoding, GitHub, StackOverFlow, etc., have also seen an increase in interactivity as programmers tend to try new technology.

One such technology, Ray a Python Framework, is also making news. It is developed by Felipe Volpone, and the initial impression looks promising. It should also be noted that it is made with inspiration from Django and Flask, combining them so you can create powerful REST APIs. In this article, we will focus on exploring the different features of Ray framework and also build a simple blog using the framework.

Before we get started, let’s go through the key features of the Ray framework.

Key Features of Ray Framework

API development with Ray Framework is easy and fun

Comes with the uWSGI built-in server for hosting purposes

It is compatible with Pewee, Google App Engine, and SQLAlchemy.

Offers API Protection

Database Hooks and Actions in APIs are also supported

Supports authentication.

A Beginner-Level Tutorial to Ray - A New Python Framework

Installing Ray Framework

To use Ray Framework, you need to install the basic, prerequisite software and libraries to make it functional. For proper functioning and installation, you need to install the following:

Peewee ORM

Ray Framework

Ray Peewee.

To do so, you need to run the following pip commands in your linux terminal. (Note: Ubuntu 16.04 is used for the tutorial).

pip install peewee
pip install ray_framework
pip install ray_peewee

Note: Make sure you run commands using sudo or a root account.

Creating App.py for the Model Post

Posts are an important part of any blog as they constitute the core idea behind a blog. Creating a model will ensure they are shown correctly, and interact with the database. To do so, we need to create “app.py” file with the model post. Check the code below on how to approach it:

And there you go, you have successfully setup your blog using Ray framework. You can read more about Ray features such as Endpoints, hooks, authentications, etc., in the Medium article here. It is written by the Ray framework author, Felipe Volpone, himself!

Did you find the beginner-level tutorial to Ray framework useful? If so, comment and let us know. Also, share your thoughts on how you think Ray framework can impact Python web development. Is it worth the attention?