Template for a simple python FastAPI connecting to mongodb
Report Bug
·
Request Feature
Table of Contents
This is a blank template for a Python based asynchronous API. This project makes use of FastAPI, Pydantc and includes Motor as an asynchronous Python driver for MongoDB.
Some basic installation and setup details can be found below.
I'd recommend using Poetry to manage the dependecy installation/ virtual environment setup.
- Poetry
curl -sSL https://install.python-poetry.org | python3 -
- MongoDB
See the the download page or the docker image
- Clone the repo
git clone https://github.com/AwfulMoo/fastapi_mongodb_server.git
- Install Python packages (from inside the cloned repo)
poetry install
- Select the Python intpreter (use the path to the poetry virtual env created in the last step)
poetry install
- Update the config.py file to include database connection settings as needed
You can debug the application by pressing F5 in Visual Studio Code
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.
If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the project
- Create your feature branch (
git checkout -b feature/AmazingFeature
) - Make your changes
- Stage your changes (
git add yourChangedFile.filetype
) - Commit your changes (
git commit -m 'Added an AmazingFeature!'
) - Push to the branch (
git push origin feature/AmazingFeature
) - Open a pull request
Distributed under the MIT License. See LICENSE
for more information.
Project Link: https://github.com/AwfulMoo/fastapi_mongodb_server