Blog

Two-factor Authentication Using Twilio Verify API In Flask

Two-factor Authentication Using Twilio Verify API In Flask

The Twilio Verify Rest API allows you to verify that a user has a claimed device in their possession. This device will receive a verification code that could be used to authenticate a user into an account. You can choose what channels you'd like to use to verify a user of an application, either via SMS, voice, WhatsApp or email.

Time-based One-Time Password Authentication In Flask

Time-based One-Time Password Authentication In Flask

Two-factor authentication (2FA) is a security protocol that protects users by asking them to verify their identity using two methods of authentication. Organizations use 2FA techniques to safeguard their clients' data from unauthorized access.

Time-based one-time password (TOTP) is one method of implementing two-factor authentication where users are required to not only provide their passwords, but also a time-bound numeric token sent to their device. The token is counter-checked against a generated token before access is granted.

User Authentication In Flask

User Authentication In Flask

User authentication is a method that keeps unauthorized users from accessing sensitive information. Depending on the application, user data may be limited to only those with access to an account.

Typically, users are identified by their username, email, phone number, or password. The most basic form of user authentication is the password-based type. However, due to several reasons, this method does not guarantee the security of a user's account.

There are several other technologies we can utilize to help ensure that a user of an online application is safe from exposure and potential damage. In this article, we will look at a few methods that can be implemented in Flask to ensure data safety.

Integrate Google Recaptcha In Flask Web Forms

Integrate Google Recaptcha In Flask Web Forms

It is fairly common that web forms can be misused, sometimes for malicious reasons. As a developer, how do you protect against automated responses? You can use the Completely Automated Public Turing test, a type of challenge-response test, to tell computers from humans.

Although CAPTCHAs are designed to block automated bots, CAPTCHAs are themselves automated. They're programmed to pop up in certain places on a website, and they automatically pass or fail users.

Handling Rich Text In Flask

Handling Rich Text In Flask

Rich text is a more exciting way of writing text, where you have the option to add common formatting features such as bold, italics, links, and more, commonly found in 'what you see is what you get' text editors. Additionally, you can have a preview of the text you are writing so as to know what the output will look like eventually.

How To Deploy A Flask App On Docker Containers

How To Deploy A Flask App On Docker Containers

Docker is an open-source containerization platform. It enables developers to package applications into containers—standardized executable components combining application source code with the operating system (OS) libraries and dependencies required to run that code in any environment. The isolation and security allow you to run many containers simultaneously on a given host.

More portable and resource-efficient than virtual machines (VMs), containers have become the de facto compute units of modern cloud-native applications.

How To Install Docker in Ubuntu 20.04

How To Install Docker in Ubuntu 20.04

Docker is an application that allows you to manage application processes using containers. These containers work in a similar manner as virtual machines but are rather more portable, resource-friendly and OS-dependant. In this tutorial, you’ll install and use Docker Community Edition (CE) on Ubuntu 20.04.

Upload Files To A Database In Your Flask App

Upload Files To A Database In Your Flask App

You probably are already familiar with how to update a table in your flask database, for example, you know how to add a new user who has just registered for an account in your application. This user may want to update their profile image, or simply attach a file needed in a submission. How can you handle this need in your flask application?

Welcome to Linode

Welcome to Linode

Flask provides a built-in development server to be used during testing. Unfortunately, this server has serious limitations beyond testing purposes. This is by design and true to Flask's core philosophy of being lean but extensible. In production, Flask recommends that you look elsewhere, such as at Heroku, Python Anywhere among others. Most of these hosting servers are cloud-based, and they do an excellent job of lifting the heavy burden of server setup, hosting and maintenance from the developer.

On the other side, if you would like to know and understand what goes on behind the hosting services, you can choose to host your flask application yourself. Your Flask application, being Python-based, will require a Linux server for self-hosting needs. This is where Linode comes in.

HTTP Life Cycle

HTTP Life Cycle

The basis of any web interaction is for a user to ask for information and receive that information. A user, the person sitting behind a browser, can type in something in a browser's URL bar, and the browser will in turn display some information back to the user. The information can be exactly what the user asked for or some feedback saying that the requested resource could not be found.

The browser in this operation is the client who requests a server, this can be Google, for information. Google will in turn respond with the requested information or an alternative feedback. This process of sending and receiving information in the web is what is referred to as the HTTP Life Cycle.

Secure Your Domain Name With SSL

Secure Your Domain Name With SSL

If you want your website visitors and potential customers to trust your site, you need a SSL or TLS certificate installed on your website. SSL is a technology that keeps your website visitors' personal information private when they submit it to your site. If your website isn’t secure, or doesn’t use TLS, formerly known as SSL, then hackers can intercept and read the information being transmitted. This is called a man-in-the-middle attack, and the consequences can be devastating.

For some time now, Google has categorically been using HTTPS as a ranking signal in search results. This means that if your website has SSL then it’s more likely to show up higher in SERPs (search engine result pages) than a site that isn’t secure.

Buy A Domain Name For Your Deployed Flask Application

Buy A Domain Name For Your Deployed Flask Application

Every website on the internet has an IP address. These addresses point to a website's location. IP addresses are generally a set of numbers such as 142.250.203.206. These addresses can quickly become difficult to remember, more so if you have multiple websites' IP addresses. A domain name is a memorable name that maps to a particular website's IP address, and are typically what you would type in a browser's URL bar. An example of a domain name mapping to the IP 142.250.203.206 is google.com.

If you have deployed an application on a server, say a Linux server, your host has assigned your application an IP address. You can get yourself a memorable domain name that your users can easily recall when interacting with your application on the internet.

Deploy Your Flask App On Linode Server

Deploy Your Flask App On Linode Server

Linode is a cloud hosting provider that focuses on providing Linux powered virtual machines to support a wide range of applications. Even though many experts do not see it as a beginner-friendly, statistically, most developers prefer Linux as their development and deployment environment. It is, therefore, an excellent choice for developers who wish to work with an end-to-end Linux based application workflow.

Test Your Locally Running App On Another Device

Test Your Locally Running App On Another Device

Have you ever wondered how you can view your locally running application on another device such as your mobile phone? You probably would love to get feedback on your application before deploying, but you are faced with the fact that your computer has a firewall that does not allow for external access. The good news is that it is possible to bypass this limitation and still share a link to your application with a friend who lives on a different part of the world for testing purposes.

Start A Flask Server

Start A Flask Server

Flask is a lightweight Python framework for web applications that provides the basics for URL routing and page rendering. Its philosophy aims to keep the core simple but extensible. Over the years, there has been considerable design changes that have been made to Flask, but the core has largely remained the same. This article is going to explore how you can start your Flask development server to test an application that is running locally in your machine.

Install and Configure Virtualenvwrapper In Ubuntu 20.04

Install and Configure Virtualenvwrapper In Ubuntu 20.04

Virtual environments are key to safely tinkering with different versions of Python and combinations of packages. They also allow you to install different versions of the same library for different projects, which resolves what would be impossible if all of your projects' requirements were installed in the same environment.

Virtualenvwrapper is a set of extensions for creating and deleting virtual environments and otherwise managing your development workflow, making it easier to work on more than one project at a time without introducing conflicts in their dependencies.

Connect to GitHub Using SSH

Connect to GitHub Using SSH

You can connect to GitHub using the Secure Shell Protocol (SSH), which provides a secure channel over an unsecured network. This protocol can connect and authenticate remote servers and services. With SSH keys, you can connect to GitHub without supplying your username and personal access token at each visit.

Install and Configure Git In Ubuntu

Install and Configure Git In Ubuntu

Git is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows.

Git allows and encourages you to have multiple local branches that can be entirely independent of each other. The creation, merging, and deletion of those lines of development takes seconds.

Welcome to My Blog

Welcome to My Blog

Hello,

I am glad that you have stopped by. This is my personal blog engine. I decided to put it together for two broad reasons:

  • To share what I know thus far
  • To show some of the interesting things I have been up to



I hope that you find something that interests you. If you enjoy whatever you find, I will be glad to hear from you in the comments sections.

Gitau Harrison