• python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Facebook Twitter Instagram
Devs Fixed
  • python
  • javascript
  • reactjs
  • sql
  • c#
  • java
Devs Fixed
Home ยป Resolved: __init__.py : TypeError: %d format: a number is required, not str

Resolved: __init__.py : TypeError: %d format: a number is required, not str

0
By Isaac Tonny on 17/06/2022 Issue
Share
Facebook Twitter LinkedIn

Question:

I’m very new to Python. I’m trying to make a simple web server that pulls data from my mongodb DB.
This is my files architecture:
enter image description here
This is my code:
This is my error:
The longer error log is:
enter image description here

Answer:

That line is causing the problem. port needs to be an integer, but you’re passing it as a string.
Convert it to an integer by wrapping the value in int(), like this:

If you have better answer, please add a comment about this, thank you!

fastapi python
Share. Facebook Twitter LinkedIn

Related Posts

Resolved: Best way to create 3d matrix of variables in PULP

24/03/2023

Resolved: Openlayers: Update clusters depending on filter (geometryFunction)

24/03/2023

Resolved: Getting ‘502 Bad Gateway’ while deploying Springboot app in EKS

24/03/2023

Leave A Reply

© 2023 DEVSFIX.COM

Type above and press Enter to search. Press Esc to cancel.