Running Asynchronous background Tasks on Linux with Python 3 Flask and Celery

Running Asynchronous background Tasks on Linux with Python 3 Flask and CeleryIn this tutorial I will describe how you can run asynchronous tasks on Linux using Celery an asynchronous task queue manager. While running scripts on Linux some tasks which take time to complete can be done asynchronously. For example a System Update. With Celery you can run such tasks asynchronously in the background and then... Read More »

Installing and Securing Nginx Websites on Linux with a Free SSL/TLS Certificate from Let’s Encrypt

Installing and Securing Nginx Websites on Linux with a Free SSL/TLS Certificate from Let’s EncryptLet’s Encrypt is a free, automated, and open SSL/TLS Certificate authority (CA) that allows you to acquire Free SSL/TLS Certificates for your web server provided your verify your Domain. In this tutorial I will describe how you can download and install a Free Let’s Encrypt SSL/TLS Certificate on Linux for Nginx Pr-requisites An Nginx  Web Server... Read More »

How to Build Database driven RESTFUL API Applications with Flask, Flask-RESTFUL and Angularjs’s $resource service

How to Build  Database driven RESTFUL API Applications with Flask, Flask-RESTFUL and Angularjs’s $resource serviceIn this tutorial I will describe how you can Build a RESTFUL API CRUD(Create, Read, Update and Delete) application with the Flask Python Micro-framework, and the Angularjs $resource Service. I be will using the Flask-RESTFUL API extension to create an API backend and then use Angularjs’s $resource service to communicate with it. Prerequisites This Tutorial... Read More »

Real Time Linux Server Monitoring with Node.js Socket.io and D3.js

Real Time Linux Server Monitoring with Node.js Socket.io and D3.jsIn this article I will describe how you can visualize the real time Memory and CPU usage of a Linux Server using Socket.io and D3.js gauges. Before we dive into the code, here is a little background on the Technology. Socket.io Socket.io is a javascript library that uses Sockets for fast real time communication. With... Read More »

Buidling a database driven RESTFUL JSON API in Python 3 with Flask Flask-Restful and SQLAlchemy

Buidling a database driven RESTFUL JSON API  in Python 3 with Flask Flask-Restful and  SQLAlchemyIn this tutorial I will be describing how you can quickly build a simple database driven Create,  Read,  Update and Delete JSON API in Python 3 with  Flask and it’s extensions namely Flask-Restful and Flask-SQLAlchemy. Before we start, here’s what you should know about REST. What is REST? REST is  a programming style which describes... Read More »

JSON web token authentication with Flask and Angularjs

JSON web token authentication with  Flask and AngularjsJSON  web tokens  (JWT)  are a mechanism in which a  token is used instead of a username/password to authenticate  API users.  Token’s are  more secure because they can contain a scope ( Access Level) and an Expiry. Thus in case of a compromise the attacker has very limited access to your data. They can also... Read More »

Continuously deploying your Flask/Python code to your Linux production server with GitHub webhooks

Continuously deploying your Flask/Python code  to your Linux production server with GitHub webhooksIn this article I will describe how you can deploy your Flask or python code in your GitHub Repository to your Linux production server as soon as you have committed a change. What is a GitHub Webhook? GitHub Webhooks allow you to set triggers for specific events like a PUSH to your GitHub repository. When... Read More »

Many to Many Relationships with Flask-SQLALchemy

Many to Many Relationships with Flask-SQLALchemyIn my earlier post I described how to create  a One to Many relationship with Flask-SQLAlchemy . In this post I will describe how to create a Many to Many relationship with Flask-SQLAlcehmy . Defining a Many to Many relationship. A  Many to Many Relationship between two entities can be defined as one in which a... Read More »

One to Many Relationships with Flask-SQLAlchemy

One to Many Relationships with Flask-SQLAlchemyWhile building database applications with Flask-SQLAlchemy, you will come across a situation where you need to define a relationship between two database tables. While creating blogging application I came across such a situation where I had to define a One to Many Relationship between a blog post (Post Table) and post comments(Comments Table). In order... Read More »

Python PostgreSQL example

Python PostgreSQL exampleIn this post I will describe how you can connect to a  PostgreSQL database  with Psycop2 , SQLAlchemy and Flask. Update: I have written a  python script which lets you create a CRUD app along with validations in Python and PostgreSQL by simply specifying the  database fields, You can download it from https://github.com/Leo-G/Flask-Scaffold. Software versions Python 3.4 PostgreSQL 9.3... Read More »