Managing FastAPI Projects with Poetry: A Step-by-Step Guide

Image
This guide will walk you through how to use Poetry to manage dependencies and structure your project in FastAPI . It includes detailed explanations of Poetry's core concepts and commands to help prevent issues that can arise during team collaboration and deployment. 1. What is Poetry? Poetry is a dependency management and packaging tool for Python. It goes beyond simply installing libraries by allowing you to clearly declare the dependencies your project needs and ensuring that all developers on the project have the same library versions. Clarity in Dependency Management : Explicitly manage your project's basic information and required libraries through the pyproject.toml file. Reproducible Builds : By locking all dependency versions in the poetry.lock file, it fundamentally prevents "it works on my machine" problems. Integrated Development Environment : It automatically creates and manages isolated virtual environments for each project and handles mo...

How to Set a Static IP Address for WiFi on Ubuntu 22.04 using Netplan

When I use WiFi on my test laptop, its IP address sometimes changes.
Because of this, I have to update the IP address on other client devices or change the settings of the application running on the test laptop.
It would be easier to set a fixed IP address for the test laptop directly on the router, but I can't do that because of security policies.
So, I decided to set a static IP address on the test laptop itself.


Check Ubuntu version

$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:        22.04
Codename:       jammy


1. Check Your WiFi Interface Name

$ ip address | grep 192
  inet 192.168.1.95/24 brd 192.168.1.255 scope global wlp3s0


2. Locate the Netplan Configuration File

$ cd /etc/netplan
/etc/netplan$ ls
01-network-manager-all.yaml


3. Back Up the Original File

$ sudo cp 01-network-manager-all.yaml 01-network-manager-all.org

4. Edit the Netplan YAML File

$ sudo vim 01-network-manager-all.yaml

network:
  version: 2
  renderer: networkd  # Change the renderer
  wifis:
    wlp3s0:  # Your WiFi interface name
      dhcp4: no  # Disable DHCP to use a static IP
      addresses:
        - 192.168.1.144/24  # Your desired static IP address
      routes:
        - to: default
          via: 192.168.1.254  # Your router's IP address (gateway)
      nameservers:
        addresses: [8.8.8.8, 1.1.1.1]  # DNS servers
      access-points:
        "Your_WiFi_SSID":
          password: "Your_WiFi_Password"

5. Apply the Configuration

$ sudo netplan try or $ sudo netplan apply

What Is a Renderer?

The renderer is a tool responsible for applying your network settings. Ubuntu supports two main renderers. Using networkd is recommended for more predictable and conflict-free static IP setups.

Renderer

Description

Use cases

NetworkManager

Desktop-oriented, supports GUI tools and the nmcli command line tool.

Laptops,

desktops

networkd

Lightweight and stable, suitable for static configuration via YAML.

Servers,

static IP use



Comments

Popular posts from this blog

Resolving Key Exchange Failure When Connecting with SecureCRT to OpenSSH

SecureCRT] How to Back Up and Restore SecureCRT Settings on Windows

How to Set Up Vaultwarden (Bitwarden) on Synology NAS (Best Free Alternative to LastPass)