<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Daniel Adeboye</title>
    <description>The latest articles on Forem by Daniel Adeboye (@adeboyedn).</description>
    <link>https://forem.com/adeboyedn</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F869784%2F4caf3b76-82c7-4820-bd4b-24ba40795d19.jpg</url>
      <title>Forem: Daniel Adeboye</title>
      <link>https://forem.com/adeboyedn</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/adeboyedn"/>
    <language>en</language>
    <item>
      <title>How to Build a Python API from Scratch with FastAPI</title>
      <dc:creator>Daniel Adeboye</dc:creator>
      <pubDate>Thu, 05 Sep 2024 07:10:07 +0000</pubDate>
      <link>https://forem.com/adeboyedn/how-to-build-a-python-api-from-scratch-with-fastapi-2p92</link>
      <guid>https://forem.com/adeboyedn/how-to-build-a-python-api-from-scratch-with-fastapi-2p92</guid>
      <description>&lt;p&gt;Python has always been my go-to when building APIs for any of my projects, and in this tutorial, we’re going to build a simple blog application API using FastAPI. We’ll start with structuring our FastAPI project, installing the necessary dependencies, creating our application model structure, writing the functionalities for our application, and finally testing out our API.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;💡 If you are interested in building something similar using Python Flask, you can check out my 1-hour-long video tutorial on &lt;a href="https://youtu.be/VLkE5XjPx3Y?si=NkfV2cnr4qA1Fpzm" rel="noopener noreferrer"&gt;Youtube&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Prerequisites
&lt;/h2&gt;

&lt;p&gt;To follow this tutorial, you should have:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Basic knowledge of &lt;a href="https://www.python.org/" rel="noopener noreferrer"&gt;Python&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;Basic knowledge of &lt;a href="https://www.postman.com/what-is-an-api/" rel="noopener noreferrer"&gt;API and how it works&lt;/a&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  These are the steps that we will cover:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Step 1 - Project Setup&lt;/li&gt;
&lt;li&gt;Step 2 - Running our first basic application&lt;/li&gt;
&lt;li&gt;Step 3 - Creating our Application Model Structure&lt;/li&gt;
&lt;li&gt;Step 4 - Writing our Application CRUD functionalities&lt;/li&gt;
&lt;li&gt;Step 5 - Testing our API endpoints&lt;/li&gt;
&lt;li&gt;Step 6 - Exercise&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Step 1 - Project Setup
&lt;/h2&gt;

&lt;p&gt;In this section we will focus on setting up our project, starting with folder creation, environment setup, and installing necessary dependencies.&lt;/p&gt;

&lt;h3&gt;
  
  
  Folder Creation
&lt;/h3&gt;

&lt;p&gt;On your terminal create a project directory with any name of your choice. In my case I will call my project “anvil-blog”. You can also do this using your computer’s file explorer user interface.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;mkdir&lt;/span&gt; &lt;span class="n"&gt;anvil&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;blog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After creating your application folder, you will need to change your directory into “anvil-blog”.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;cd&lt;/span&gt; &lt;span class="n"&gt;anvil&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;blog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Environment Setup
&lt;/h3&gt;

&lt;p&gt;Inside your project directory, we will create and activate a virtual environment, which will house all of our application dependencies. In this case, I called it “env”.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;python &lt;span class="nt"&gt;-m&lt;/span&gt; venv &lt;span class="nb"&gt;env&lt;/span&gt;
&lt;span class="nv"&gt;$ &lt;/span&gt;&lt;span class="nb"&gt;env&lt;/span&gt;/bin/activate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Installing Dependencies
&lt;/h3&gt;

&lt;p&gt;To build our API using FastAPI, we need to install necessary dependencies that will help our application run smoothly, and below are what we need:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://fastapi.tiangolo.com/" rel="noopener noreferrer"&gt;FastAPI&lt;/a&gt; - A web framework for building APIs with Python.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.uvicorn.org/" rel="noopener noreferrer"&gt;Uvicorn&lt;/a&gt; - An ASGI web server implementation for Python&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://pydantic.dev/" rel="noopener noreferrer"&gt;Pydantic&lt;/a&gt; - A data validation library for Python.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run the command below to install these packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;
&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;env&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;pip &lt;span class="nb"&gt;install &lt;/span&gt;fastapi uvicorn pydantic
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step 2 - Running our first basic application
&lt;/h2&gt;

&lt;h3&gt;
  
  
  Application Setup
&lt;/h3&gt;

&lt;p&gt;Now that we have our project environment setup, it’s time to write some FastAPI code. Create a new file in your project folder and name it “main.py”, this is where we’ll write all of our application code. &lt;/p&gt;

&lt;p&gt;Let’s add this code to our “main.py” file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;uvicorn&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;anvil&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;hello&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;world&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

    &lt;span class="n"&gt;uvicorn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0.0.0.0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s break down the above code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;@app.get("/")&lt;/code&gt;&lt;/strong&gt; defines a route for our FastAPI application. When someone accesses the root URL (&lt;code&gt;/&lt;/code&gt;), the &lt;code&gt;anvil&lt;/code&gt; function is called. This function simply returns a JSON response with the message &lt;code&gt;"hello": "world"&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;if __name__ == "__main__":&lt;/code&gt;&lt;/strong&gt; ensures that our code runs only when the script is executed directly. Inside this block, &lt;code&gt;uvicorn.run&lt;/code&gt; is called to start the Uvicorn server, which serves our FastAPI app at the specified host (&lt;code&gt;0.0.0.0&lt;/code&gt;) and port (&lt;code&gt;8000&lt;/code&gt;).&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Running our Application Server
&lt;/h3&gt;

&lt;p&gt;To run our application server run the command below in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;env&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;python&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;py&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You should get similar result as the image below:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitllsbj8qba83yqqur2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fitllsbj8qba83yqqur2u.png" alt="Image Server" width="617" height="168"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can now access your application at &lt;code&gt;http://localhost:8000/&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8d213x4o62shxv6uilg.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fy8d213x4o62shxv6uilg.png" alt="Image Application" width="800" height="409"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;🎉 Congratulations, we have successfully run our first FastAPI application.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Step 3 -&lt;/strong&gt; Creating our Application Model Structure ****
&lt;/h2&gt;

&lt;p&gt;Earlier we installed &lt;a href="https://www.notion.so/How-to-Build-a-Python-API-from-Scratch-with-FastAPI-281fc3d2f43f4e6fb1eab23535231562?pvs=21" rel="noopener noreferrer"&gt;Pydantic&lt;/a&gt;, a library that helps us validate and serialize data schemas, we’ll use this library to create our application model structure.&lt;/p&gt;

&lt;p&gt;Let’s add this code to our “main.py” file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;uuid4&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's break down the code:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;We've used &lt;code&gt;UUID&lt;/code&gt;  also known as universally unique identifier, to ensure that each &lt;code&gt;Blog&lt;/code&gt; instance has a unique identifier. This helps us guarantee that the &lt;code&gt;id&lt;/code&gt; for each blog post is always unique.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;Optional&lt;/code&gt; type indicates that the &lt;code&gt;id&lt;/code&gt; field is not required when a new blog post is created. If the &lt;code&gt;id&lt;/code&gt; is not provided, it defaults to &lt;code&gt;None&lt;/code&gt;, allowing the system to generate it automatically.&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Creating a Temporary Database for our Model
&lt;/h3&gt;

&lt;p&gt;Because we are not using a real database in this tutorial, we are going to use a list instead. Let’s add the code below under our &lt;code&gt;Blog&lt;/code&gt; model:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;blogs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is what your “main.py” file should look like:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;uvicorn&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;fastapi&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;FastAPI&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;pydantic&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;BaseModel&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;typing&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;
&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;uuid&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;uuid4&lt;/span&gt;

&lt;span class="n"&gt;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nc"&gt;FastAPI&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;BaseModel&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nb"&gt;id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Optional&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="bp"&gt;None&lt;/span&gt;
    &lt;span class="n"&gt;title&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;
    &lt;span class="n"&gt;description&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nb"&gt;str&lt;/span&gt;

&lt;span class="n"&gt;blogs&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[]&lt;/span&gt;

&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;__name__&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;__main__&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;

    &lt;span class="n"&gt;uvicorn&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;run&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;app&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;host&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;0.0.0.0&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;port&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;8000&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Step - 4 Writing our Application CRUD functionalities
&lt;/h2&gt;

&lt;p&gt;You might be curious about what CRUD stands for. It represents the four main operations commonly performed in most applications: Create, Read, Update, and Delete.&lt;/p&gt;

&lt;h3&gt;
  
  
  Create Blog Post API
&lt;/h3&gt;

&lt;p&gt;In the Create Blog Post API, we're going to allow users to create blog posts. Here's how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/blogs/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;create_blog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blog&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;blog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;uuid4&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
    &lt;span class="n"&gt;blogs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;blog&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's break down the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;response_model=Blog&lt;/code&gt;&lt;/strong&gt; tells FastAPI to use the &lt;code&gt;Blog&lt;/code&gt; model to structure the JSON response returned from the &lt;code&gt;/blogs/&lt;/code&gt; route.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;(blog: Blog)&lt;/code&gt;&lt;/strong&gt; specifies that we want to accept a new blog post using our &lt;code&gt;Blog&lt;/code&gt; model.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;blogs.append(blog)&lt;/code&gt;&lt;/strong&gt; as you might already know adds the new blog post to our temporary &lt;a href="https://www.notion.so/How-to-Build-a-Python-API-from-Scratch-with-FastAPI-281fc3d2f43f4e6fb1eab23535231562?pvs=21" rel="noopener noreferrer"&gt;database&lt;/a&gt;, which is represented by the &lt;code&gt;blogs[]&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Get Blog List API
&lt;/h3&gt;

&lt;p&gt;In the Get Blog List API, we're going to allow users to retrieve all the blog posts they have created. Here's how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/blogs/&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nb"&gt;list&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;list_blogs&lt;/span&gt;&lt;span class="p"&gt;():&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;blogs&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's break down the code:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;response_model=list[Blog]&lt;/code&gt;&lt;/strong&gt; as you might already know tells FastAPI that the response will be a list of &lt;code&gt;Blog&lt;/code&gt; objects.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;return blogs&lt;/code&gt;&lt;/strong&gt;: This line returns the entire list of blog posts stored in our temporary database, which is the &lt;code&gt;blogs[]&lt;/code&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Update Blog Post API
&lt;/h3&gt;

&lt;p&gt;In the Update Blog Post API, we allow users to modify an existing blog post by providing its unique identifier (UUID) and the new data they wish to update. Here’s how it works:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.put&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/blog/{blog_id}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;update_blog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blog_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;blog_update&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;blog&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blogs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;blog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;blog_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="n"&gt;updated_blog&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;blog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;copy&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;update&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;blog_update&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;dict&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;exclude_unset&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;True&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
            &lt;span class="n"&gt;blogs&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;updated_blog&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;updated_blog&lt;/span&gt;

    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Blog not found&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code looks a bit more complex than the previous ones we've written, so let’s break it down:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;@app.put("/blogs/{blog_id}")&lt;/code&gt;&lt;/strong&gt; route makes the update function accessible. The &lt;code&gt;{blog_id}&lt;/code&gt; part is a path parameter that takes the unique identifier of the blog post you want to update.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;blog_update: Blog&lt;/code&gt;&lt;/strong&gt;: This parameter indicates that the request body should contain a &lt;code&gt;Blog&lt;/code&gt; model with the new data to be applied.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;update_blog&lt;/code&gt; function iterates through the &lt;code&gt;blogs&lt;/code&gt; list and checks for a blog post with a matching &lt;code&gt;blog_id&lt;/code&gt;. When it finds a match, it updates that entry using the &lt;code&gt;copy(update=blog_update.dict(exclude_unset=True))&lt;/code&gt; method. This method updates only the fields provided in the request, leaving the others unchanged.&lt;/li&gt;
&lt;li&gt;If the blog post is found and updated, the function returns the updated blog. If not, it raises an &lt;code&gt;HTTPException&lt;/code&gt; with a 404 status code, indicating that the blog post was not found.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  Delete Blog Post API
&lt;/h3&gt;

&lt;p&gt;For this functionality, we want to allow users to remove a blog post by providing its unique identifier (UUID).&lt;/p&gt;

&lt;p&gt;Let’s add this code to our "main.py" file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="nd"&gt;@app.delete&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;/blogs/{blog_id}&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;response_model&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;Blog&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;delete_blog&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blog_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;UUID&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;blog&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="nf"&gt;enumerate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;blogs&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;blog&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nb"&gt;id&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="n"&gt;blog_id&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;blogs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;pop&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;idx&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

    &lt;span class="k"&gt;raise&lt;/span&gt; &lt;span class="nc"&gt;HTTPException&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;status_code&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;404&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;detail&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Blog not found&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let’s break down the above code: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;&lt;code&gt;@app.delete("/blogs/{blog_id}")&lt;/code&gt;&lt;/strong&gt; as you might already know, this route provides access to the delete function. Similar to the update route, &lt;code&gt;{blog_id}&lt;/code&gt; is a path parameter that takes the unique identifier of the blog post you want to delete.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;delete_blog&lt;/code&gt; function iterates through the &lt;code&gt;blogs&lt;/code&gt; list, and if it finds a blog post with a matching &lt;code&gt;blog_id&lt;/code&gt;, it removes that post from the list using &lt;code&gt;pop(idx)&lt;/code&gt; and returns the deleted blog.&lt;/li&gt;
&lt;li&gt;If the blog post is not found, the function raises an &lt;code&gt;HTTPException&lt;/code&gt; with a 404 status code, indicating that the blog post was not found.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;💡 You can access the entire code for this tutorial on &lt;a href="https://github.com/AdeboyeDN/anvil-blog" rel="noopener noreferrer"&gt;GitHub&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 5 - Testing our APIs
&lt;/h2&gt;

&lt;p&gt;To test our application APIs, start your FastAPI project server using the command below in your terminal:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;env&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;python main.py 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;FastAPI, by default, automatically generates API documentation without any extra setup. To access your project’s API documentation, head over to &lt;code&gt;http://localhost:8000/docs#/&lt;/code&gt; .&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9iapc295v1w46ugqj3jk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9iapc295v1w46ugqj3jk.png" alt="Image API" width="800" height="373"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;You can also test your API endpoints using the API documentation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Step 6 - Exercise
&lt;/h2&gt;

&lt;p&gt;Write an API that gets individual blogs via their &lt;code&gt;id&lt;/code&gt;. Submit your answer as a pull request on this &lt;a href="https://github.com/AdeboyeDN/anvil-blog" rel="noopener noreferrer"&gt;repository&lt;/a&gt;. I will give you feedback in 1-2 weeks. If you want a faster review, you can tag me on X with the URL to your pull request.&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In this article, we learned how to build a Python API using FastAPI. We covered setting up a FastAPI project, defining the project model structure with Pydantic, implementing CRUD functionalities for our blog, and testing our APIs.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Comparing PaaS and Traditional DevOps: Choosing the Right Approach for Your Software Development Process</title>
      <dc:creator>Daniel Adeboye</dc:creator>
      <pubDate>Fri, 16 Jun 2023 08:28:56 +0000</pubDate>
      <link>https://forem.com/adeboyedn/comparing-paas-and-traditional-devops-choosing-the-right-approach-for-your-software-development-process-2bh6</link>
      <guid>https://forem.com/adeboyedn/comparing-paas-and-traditional-devops-choosing-the-right-approach-for-your-software-development-process-2bh6</guid>
      <description>&lt;p&gt;In the world of software development, there are different approaches to managing infrastructure and deploying applications. Two popular options are Platform as a Service (PaaS) and traditional DevOps processes. While both have their merits, understanding the key differences between them is crucial for making informed decisions about which approach best suits your development needs. &lt;/p&gt;

&lt;p&gt;At &lt;strong&gt;PipeOps&lt;/strong&gt;, one of our goals is to simplify the cloud deployment and infrastructure management process, and in this article, we will compare PaaS and traditional DevOps across various aspects, helping you make an informed choice.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is Traditional DevOps?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Traditional DevOps involves the collaborative efforts of development and operations teams to streamline the software development lifecycle. It focuses on breaking down silos between teams, emphasizing collaboration, automation, and continuous integration and delivery. With traditional DevOps, developers assume responsibility for managing infrastructure, configuring servers, operating systems, and networking components to support application deployment and scaling.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What is PaaS?&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;Platform as a Service (PaaS) is a cloud computing model that abstracts away infrastructure management. PaaS providers like &lt;strong&gt;PipeOps&lt;/strong&gt; offer a platform where developers can build, deploy, and manage applications without the need to worry about the underlying infrastructure. PaaS handles provisioning, scaling, and maintenance of the infrastructure, allowing developers to focus more on application development and deployment.&lt;/p&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;What are their differences?&lt;/strong&gt;
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Infrastructure Management:&lt;/strong&gt; In traditional DevOps, developers take on the responsibility of managing infrastructure, configuring servers, operating systems, and networking components. On the other hand, PaaS abstracts away infrastructure management. PaaS providers handle the provisioning and maintenance of the underlying infrastructure, enabling developers to focus more on application development and deployment.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability:&lt;/strong&gt; Scaling applications in a traditional DevOps setup often requires manual intervention. Developers must provision additional servers, configure load balancers, and manage traffic distribution to accommodate increasing demand. PaaS platforms, on the other hand, offer automatic scalability. They can dynamically allocate resources based on demand, allowing applications to scale up or down seamlessly without requiring manual intervention from developers.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Deployment Process:&lt;/strong&gt; Deploying applications in a traditional DevOps process involves configuring and managing deployment pipelines, setting up build servers, and handling deployment scripts or tools. This can be a time-consuming and complex process. PaaS platforms provide built-in deployment capabilities, simplifying the deployment process. Developers can deploy applications using a simple interface or command-line tool, abstracting away many of the deployment complexities associated with traditional DevOps.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Configuration Management:&lt;/strong&gt; In traditional DevOps, configuration management often involves using tools like Chef, Puppet, or Ansible to manage server configurations, environment variables, and dependencies. PaaS platforms typically include configuration management capabilities as part of their offering. Developers can define application configurations and environment variables directly within the platform, simplifying the configuration management process.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Flexibility and Customization:&lt;/strong&gt; Traditional DevOps processes provide greater flexibility and customization options. Developers have more control over infrastructure, software versions, and configurations, enabling tailored setups. PaaS platforms, while offering convenience and ease of use, may have some limitations on customization. Developers might encounter constraints when it comes to specific infrastructure configurations or software versions.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Responsibility and Maintenance:&lt;/strong&gt; In traditional DevOps setups, developers are responsible for managing and maintaining the entire infrastructure stack. This includes security updates, patches, backups, and overall system maintenance. PaaS providers handle much of the underlying infrastructure maintenance, including security updates and backups. However, developers are still responsible for ensuring the security and maintenance of their application code.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  &lt;strong&gt;Use PipeOps For Infrastructure Management&lt;/strong&gt;
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkenmpmdco84acviozpmp.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fkenmpmdco84acviozpmp.jpg" alt="PipeOps" width="800" height="449"&gt;&lt;/a&gt;&lt;br&gt;
In this article, we have explored the concepts of PaaS and traditional DevOps, highlighting the key distinctions between them. The decision between adopting PaaS or sticking with traditional DevOps depends on several factors, such as project requirements, the level of control desired, and the trade-offs between convenience and flexibility.&lt;/p&gt;

&lt;p&gt;PipeOps makes it easier for developer and dev-teams to deploy and manage their applications without worrying about the underlying infrastructure and with just few clicks you have everything up and ruining: &lt;strong&gt;&lt;a href="https://pipeops.io/" rel="noopener noreferrer"&gt;try PipeOps for free now&lt;/a&gt;&lt;/strong&gt; and forget worrying about the cost and risk of managing your cloud infrastructure. It only takes a minute to get started.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>10 Best Deployment Platforms</title>
      <dc:creator>Daniel Adeboye</dc:creator>
      <pubDate>Thu, 09 Mar 2023 13:36:53 +0000</pubDate>
      <link>https://forem.com/adeboyedn/10-best-deployment-platforms-fh7</link>
      <guid>https://forem.com/adeboyedn/10-best-deployment-platforms-fh7</guid>
      <description>&lt;h2&gt;
  
  
  Introduction
&lt;/h2&gt;

&lt;p&gt;As businesses increasingly rely on digital platforms, the need for efficient and effective deployment solutions has become critical. With so many options available, choosing the right deployment tool can be overwhelming for developers and businesses alike. In this article, we'll explore some of the best deployment options available for businesses of all sizes, from small startups to enterprise-level companies.&lt;/p&gt;

&lt;p&gt;In addition, we'll introduce you to PipeOps, a no-code tool for cloud deployments and infrastructure management. With PipeOps, developers can easily set up and manage their cloud infrastructure, so they can focus on building their product and serving their customers. With PipeOps, deploying your applications has never been easier.&lt;/p&gt;

&lt;h2&gt;
  
  
  What Is A Deployment Platform?
&lt;/h2&gt;

&lt;p&gt;A deployment platform is a software tool or set of tools that automates the process of deploying software applications and services to production environments. It provides developers with a range of tools and services to quickly and efficiently deploy their applications and services to production environments. By automating the deployment process, deployment platforms help to reduce errors and speed up the time it takes to get applications up and running. This ultimately leads to faster delivery of high-quality software products to customers.&lt;/p&gt;

&lt;h2&gt;
  
  
  Why Are Deployment Platforms Important?
&lt;/h2&gt;

&lt;p&gt;Deployment platforms are essential for modern software development, and here are four reasons why they are important:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Automation&lt;/strong&gt;: Deployment platforms automate the deployment process, eliminating manual errors that can occur during deployment. Automation also reduces the time and effort required to deploy applications, enabling developers to focus on creating and improving software.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Consistency&lt;/strong&gt;: Deployment platforms help to ensure consistency in the deployment process. By using standard processes and templates, deployment platforms make it easier to maintain consistency across different environments, such as development, testing, and production.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Scalability&lt;/strong&gt;: Deployment platforms are designed to handle large-scale deployments, making them essential for businesses that need to deploy applications across multiple environments or regions. With deployment platforms, businesses can easily scale up their infrastructure to meet increasing demands, without sacrificing efficiency or reliability.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Collaboration&lt;/strong&gt;: Deployment platforms enable teams to collaborate more effectively by providing a centralized location for managing deployment workflows, configuration files, and version control. This makes it easier for teams to work together, track changes, and ensure that everyone is working from the same codebase and deployment process.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Types Of Deployment Platforms.
&lt;/h2&gt;

&lt;p&gt;As the demand for streamlined deployment processes continues to grow, there are now many different types of deployment platforms available, each with its unique features and benefits. Here are some of the most popular types of deployment platforms in use today:&lt;/p&gt;

&lt;h3&gt;
  
  
  Northflank
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://northflank.com" rel="noopener noreferrer"&gt;Northflank&lt;/a&gt; is a modern, cloud-native deployment platform designed to make deploying, managing, and scaling applications effortless. It offers developers an intuitive interface and powerful tools for building microservices, databases, and static sites. Northflank supports a wide range of programming languages and integrates seamlessly with popular version control systems like GitHub and GitLab.&lt;/p&gt;

&lt;p&gt;With features like automatic SSL, built-in CI/CD pipelines, real-time logs, and metrics, Northflank simplifies infrastructure management while giving teams full control over their deployments. Whether you're a startup or an enterprise, Northflank helps you ship faster and manage your applications with ease.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmazvypa1cpobd6mtyqqk.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fmazvypa1cpobd6mtyqqk.png" alt=" " width="800" height="297"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  PipeOps
&lt;/h3&gt;

&lt;p&gt;PipeOps is a no-code cloud deployment and infrastructure management tool designed to simplify the setup and management of your cloud infrastructure. With PipeOps, you can easily deploy your applications and manage your infrastructure without worrying about the underlying complexities. This allows you to focus on what really matters - building your product and serving your customers. &lt;/p&gt;

&lt;p&gt;Whether you're a seasoned developer or just starting out, PipeOps offers free plans and affordable pricing to help you get started quickly. With PipeOps, you can streamline your cloud operations and keep costs under control, so you can concentrate on delivering value to your users.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foumxjnvj9717qwtek188.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foumxjnvj9717qwtek188.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Heroku
&lt;/h3&gt;

&lt;p&gt;Heroku is a cloud-based platform that helps businesses deploy and manage their applications quickly and easily. Heroku supports multiple programming languages, including Java, Ruby, Python, and Node.js.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8c5ajmxyfkepdzr8krgv.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F8c5ajmxyfkepdzr8krgv.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Microsoft Azure
&lt;/h3&gt;

&lt;p&gt;Microsoft Azure is a cloud-based platform that provides businesses with a wide range of services, including compute, storage, networking, and analytics. Azure supports multiple programming languages, including Java, Python, and .NET.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnaujajn02n429fx3benf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnaujajn02n429fx3benf.png" alt=" " width="800" height="384"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  DigitalOcean
&lt;/h3&gt;

&lt;p&gt;DigitalOcean is a cloud-based platform that provides businesses with a simple, easy-to-use platform for deploying and managing their applications. DigitalOcean supports multiple programming languages, including Java, Python, and Ruby.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlnm52ydemghbdcuqyh6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Ftlnm52ydemghbdcuqyh6.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Vercel
&lt;/h3&gt;

&lt;p&gt;Vercel is a cloud-based platform that enables developers to deploy and manage web projects, including static and dynamic websites, APIs, and serverless functions. It supports a wide range of programming languages and frameworks, including React, Next.js, Angular, and Vue.js.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhx6gemcd5f8hboq370vc.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhx6gemcd5f8hboq370vc.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Render
&lt;/h3&gt;

&lt;p&gt;Render is a cloud-based platform that provides developers with a modern, easy-to-use infrastructure for deploying web applications and APIs. Render supports a wide range of programming languages and frameworks, including Node.js, Python, Ruby, and Go.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foaza3heucrrrlsskpc5v.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Foaza3heucrrrlsskpc5v.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Fly.io
&lt;/h3&gt;

&lt;p&gt;Fly.io is a cloud-based platform that enables developers to deploy and manage web applications, including static websites, APIs, and serverless functions. Fly.io supports a wide range of programming languages and frameworks, including Node.js, Ruby, and Go.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1z6616n7me9qfverqo9a.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1z6616n7me9qfverqo9a.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  AWS (Amazon Web Services)
&lt;/h3&gt;

&lt;p&gt;AWS is a cloud-based platform that provides businesses with a wide range of services, including compute, storage, networking, and analytics. AWS supports multiple programming languages, including Java, Python, and .NET.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwltlrqyslk4q4450cad.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fvwltlrqyslk4q4450cad.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  GCP (Google Cloud Platform)
&lt;/h3&gt;

&lt;p&gt;GCP is a cloud-based platform that provides businesses with a wide range of services, including compute, storage, networking, and analytics. GCP supports multiple programming languages, including Java, Python, and .NET.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9fgmd3r2ulo68hjhysct.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F9fgmd3r2ulo68hjhysct.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Netlify
&lt;/h3&gt;

&lt;p&gt;Netlify is a cloud-based platform that enables developers to deploy and manage web projects, including static and dynamic websites, APIs, and serverless functions. It supports a wide range of programming languages and frameworks, including React, Next.js, Angular, and Vue.js.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmmmkw1shtjse69hmksx.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fhmmmkw1shtjse69hmksx.png" alt=" " width="800" height="403"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Conclusion
&lt;/h2&gt;

&lt;p&gt;In conclusion, deployment platforms play a vital role in modern software development. They offer automation, consistency, scalability, and collaboration, making them an essential tool for businesses looking to streamline their deployment processes. With a wide range of deployment platforms available, businesses can choose the one that best suits their needs and ensure they stay competitive by delivering high-quality products and services quickly and efficiently.&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>devops</category>
      <category>webdev</category>
      <category>pipeops</category>
    </item>
    <item>
      <title>Building a Security-First Culture As A Developer or Team</title>
      <dc:creator>Daniel Adeboye</dc:creator>
      <pubDate>Tue, 07 Jun 2022 11:48:19 +0000</pubDate>
      <link>https://forem.com/adeboyedn/building-a-security-first-culture-as-a-developer-or-team-4dkc</link>
      <guid>https://forem.com/adeboyedn/building-a-security-first-culture-as-a-developer-or-team-4dkc</guid>
      <description>&lt;p&gt;Developing a security-first culture is crucial in today's digital age where cyber attacks and data breaches have become increasingly prevalent. As a developer or team, it may seem daunting to develop a security-first culture, but it's not that complex when put into practice. In this article, we'll list some activities that can help build a security-first culture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Managing Secret Credentials
&lt;/h2&gt;

&lt;p&gt;Using a .env file to hide secrets during development is a common practice, but it doesn't scale and doesn't improve codebase security. Using an enhanced tool like Onboardbase, a secure online vault for developers and teams to store and share app secrets, is a better and more improved option. Managing secret credentials the right way can help developers and teams reduce the rate of vulnerability in their codebase or project and create a good security culture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Bug Hunt Session
&lt;/h2&gt;

&lt;p&gt;Organizing a bug hunt session in a company can help the team discover issues fast and fix them before pushing to the general public. There are tools available to test codebase for bugs, leaked secret keys, and more. Gitguardian, for example, can scan codebase for leaked secret keys and reduce the stress of checking every single line of code in the codebase. Having regular bug hunt sessions and utilizing available tools can help foster a security-first culture.&lt;/p&gt;

&lt;h2&gt;
  
  
  Automate Security Initiatives
&lt;/h2&gt;

&lt;p&gt;Security automation is a machine-based execution of security actions that can detect, investigate, and remediate cyber threats with or without human intervention. Security automation can identify incoming threats, triage and prioritize alerts as they emerge, and perform automated incident response. Automating security initiatives can help create a more secure and efficient work environment.&lt;/p&gt;

&lt;h2&gt;
  
  
  Security Awareness Training
&lt;/h2&gt;

&lt;p&gt;Taking security courses and implementing security awareness training can help enlighten development teams and give them more insights on how to prioritize security when building products for themselves or the company. It is essential to put in place time and budget for taking security courses to ensure that developers are equipped with the necessary knowledge to develop a security-first culture.&lt;/p&gt;

&lt;p&gt;In conclusion, building a security-first culture is vital to protect against cyber threats and data breaches. By following the activities listed above, developers and teams can develop a security-first culture and make it an integral part of their work environment.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>devops</category>
      <category>security</category>
    </item>
  </channel>
</rss>
