By using this site, you agree to the Privacy Policy and Terms of Use.
Accept
World of SoftwareWorld of SoftwareWorld of Software
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Search
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
Reading: To Gunicorn or to Poetry, That is The Question | HackerNoon
Share
Sign In
Notification Show More
Font ResizerAa
World of SoftwareWorld of Software
Font ResizerAa
  • Software
  • Mobile
  • Computing
  • Gadget
  • Gaming
  • Videos
Search
  • News
  • Software
  • Mobile
  • Computing
  • Gaming
  • Videos
  • More
    • Gadget
    • Web Stories
    • Trending
    • Press Release
Have an existing account? Sign In
Follow US
  • Privacy
  • Terms
  • Advertise
  • Contact
Copyright © All Rights Reserved. World of Software.
World of Software > Computing > To Gunicorn or to Poetry, That is The Question | HackerNoon
Computing

To Gunicorn or to Poetry, That is The Question | HackerNoon

News Room
Last updated: 2025/07/16 at 11:09 AM
News Room Published 16 July 2025
Share
SHARE

I have a Python API that uses Flask as the framework. I have a server where I have the code. I can run the API from Poetry or Gunicorn

When to Start the server using Gunicorn

In case you need concurrency and high performance, use this command. This method is used for production environment

go to API_BDG folder and execute:

export $(grep -v '^#' ../.env | xargs) && gunicorn -w <WORKERS_QTY> -b <SERVER_IP>:<SERVER_PORT> app:app

This command is composed of 2 parts connected with && which means that the second command is executed if the first is successful.

The first part of the command is:

export $(grep -v '^#' ../.env | xargs)

Where:

  • grep -v '^#' filters out the commented lines from environment variables

  • xargs: takes the remaining lines and converts them into a single line suitable for export.

  • export $(...): sets those variables in the current shell environment so they’re accessible to processes started afterward.

The Second part of the command is:

gunircorn -w <WORKERS_QTY> -b <SERVER_IP>:<SERVER_PORT> app:app

Where:

  • -w <WORKERS_QTY> is a flag to set the number of workers to run the app

  • -b <SERVER_IP>:<SERVER_PORT> binds server IP to a port

  • app:app means “from the file app.py, import the object named app”—which is usually a Flask or FastAPI app instance.

Start the server using Poetry

In case concurrency and high performance are not necessary, use this commands. It runs API DBG using Flask (single thread)

go to API_BDG folder and execute:

poetry shell
poetry run python3 src/app.py

It looks simpler and it easier to remember. So I not have to take care of concurrency and high performance I use this.

What are your thoughts of this? when do you prefer Gunicorn or Poetry? Do you have other preferred ways to run the APIs?

Lets share opinions and keep going forward!

Sign Up For Daily Newsletter

Be keep up! Get the latest breaking news delivered straight to your inbox.
By signing up, you agree to our Terms of Use and acknowledge the data practices in our Privacy Policy. You may unsubscribe at any time.
Share This Article
Facebook Twitter Email Print
Share
What do you think?
Love0
Sad0
Happy0
Sleepy0
Angry0
Dead0
Wink0
Previous Article Apple wants to avoid another three-year wait for more ‘Severance’
Next Article Score the 11-inch Apple iPad for $50 off
Leave a comment

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Stay Connected

248.1k Like
69.1k Follow
134k Pin
54.3k Follow

Latest News

Inaugural MCP Dev Summit Charts AI Integration’s Future
News
Oppo’s secret camera sauce promises more Hasselbald goodness for future flagships | Stuff
Gadget
Optimizing Social Media Profiles for Search: A Guide for Marketers
Computing
Today's NYT Strands Hints, Answer and Help for July 17 #501 – CNET
News

You Might also Like

Computing

Optimizing Social Media Profiles for Search: A Guide for Marketers

17 Min Read
Computing

NVIDIA hit with $5.5 billion blow as US tightens chip export rules to China · TechNode

1 Min Read
Computing

How to Properly Promote Games on Social Media

19 Min Read
Computing

How Trump’s tariffs could reshape the future for Chinese tech firms · TechNode

6 Min Read
//

World of Software is your one-stop website for the latest tech news and updates, follow us now to get the news that matters to you.

Quick Link

  • Privacy Policy
  • Terms of use
  • Advertise
  • Contact

Topics

  • Computing
  • Software
  • Press Release
  • Trending

Sign Up for Our Newsletter

Subscribe to our newsletter to get our newest articles instantly!

World of SoftwareWorld of Software
Follow US
Copyright © All Rights Reserved. World of Software.
Welcome Back!

Sign in to your account

Lost your password?