Problem deploying app

Question:
Hi, I had a problem deploying my app.

import datetime
import replit  # Replit database library
from replit import db  # Importing the database feature

# Function to add an item and its lifespan
def add_item(name, lifespan):
    # The expiry date is calculated by adding the lifespan to the current date.
    expiry_date = datetime.datetime.now() + datetime.timedelta(days=lifespan)
    # Save the item and its expiry date in the database
    db[name] = expiry_date.strftime('%Y-%m-%d')  # Saving as a string in Year-Month-Day format

# Function to check if any item needs to be serviced or replaced
def check_items():
    current_time = datetime.datetime.now()
    for item in db.keys():  # Iterate through all items in the database
        expiry_date = datetime.datetime.strptime(db[item], '%Y-%m-%d')
        # Check if the current date is after the expiry date
        if current_time > expiry_date:
            print(f"The {item} needs to be serviced or replaced.")
        else:
            remaining_days = (expiry_date - current_time).days
            print(f"The {item} is okay. {remaining_days} day(s) remaining until service or replacement.")

# Main function to drive the program
def main():
    while True:
        print("\nWelcome to Time Tracker")
        print("1. Add an item")
        print("2. Check items")
        print("3. Exit")
        choice = input("What would you like to do? ")

        if choice == "1":
            name = input("Enter the name of the item: ")
            lifespan = int(input("Enter the lifespan of the item in days: "))
            add_item(name, lifespan)
            print(f"Item {name} added with a lifespan of {lifespan} days.")
        elif choice == "2":
            print("\nChecking all items...\n")
            check_items()
        elif choice == "3":
            print("Goodbye!")
            break
        else:
            print("Invalid choice. Please choose 1, 2, or 3.")

# Run the main function
if __name__ == "__main__":
    main()

Current behavior:

Desired behavior

Repl link:

Welcome to the forums, @dburgesspb!
What exactly is going wrong when you deploy? Could you send screenshots?

2 Likes