To set up a Flask application with MongoDB, you need to perform a series of steps in the terminal. Here are the necessary Bash commands:
python -m venv venv
source venv/bin/activate # On Windows use venv\Scripts\activate
pip install Flask pymongo
Windows :- Download the MongoDB installer from the official MongoDB website, then follow the installation instructions. Ubuntu:- bash code was below-- sudo apt update sudo apt install -y mongodb sudo systemctl start mongodb sudo systemctl enable mongodb
mongod & # Use '&' to run it in the background
python app.py