Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/devopsinsiders/pytodobackendmonolith
🐍 PyTodoBackendMonolith 💼repository serves as the backbone for the Todo application's backend, written in Python, embracing a monolithic architecture. It orchestrates data storage, executes business logic, and exposes unified API endpoints to the frontend. With a singular focus, it encapsulates the entire backend functionality,
https://github.com/devopsinsiders/pytodobackendmonolith
api monolithic python todoapp
Last synced: 1 day ago
JSON representation
🐍 PyTodoBackendMonolith 💼repository serves as the backbone for the Todo application's backend, written in Python, embracing a monolithic architecture. It orchestrates data storage, executes business logic, and exposes unified API endpoints to the frontend. With a singular focus, it encapsulates the entire backend functionality,
- Host: GitHub
- URL: https://github.com/devopsinsiders/pytodobackendmonolith
- Owner: devopsinsiders
- Created: 2023-11-04T20:14:12.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-06-30T09:13:01.000Z (4 months ago)
- Last Synced: 2024-07-01T21:11:19.948Z (4 months ago)
- Topics: api, monolithic, python, todoapp
- Language: Python
- Homepage: https://devopsinsiders.com
- Size: 25.4 KB
- Stars: 4
- Watchers: 2
- Forks: 11
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
Awesome Lists containing this project
README
# Running the Python Application on Azure VM
This guide will walk you through the process running a Python application using FastAPI, which interacts with a Microsoft SQL Server database using PyODBC.
## Prerequisites
Before getting started, make sure you have the following prerequisites installed on your system:
- source_image_reference = {
publisher = "Canonical"
offer = "0001-com-ubuntu-server-focal"
sku = "20_04-lts"
version = "latest"
}
- Python
- pip## Step 1: Clone the Repository
Clone the application's source code from your version control system or download it as a zip archive and extract it to your local machine.
```bash
git clone
cd
```## Step 2: Update Connection String
Edit the `app.py` file to update the `connection_string` variable with the appropriate connection details for your SQL Server database. Update ODBC Version to 17
## Step 3: Run Below Commands to make the application running
To Run the Application, open a terminal, navigate to the project directory, and run the following command:
```bash
sudo su
apt-get update && apt-get install -y unixodbc unixodbc-dev
curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
curl https://packages.microsoft.com/config/debian/10/prod.list > /etc/apt/sources.list.d/mssql-release.list
apt-get update
ACCEPT_EULA=Y apt-get install -y msodbcsql17
pip install -r requirements.txt
uvicorn app:app --host 0.0.0.0 --port 8000
```## Step 4: Access the Application
Your Python application is now running. You can access it by opening a web browser or sending HTTP requests to `http://localhost:8000` or by using VM's Public IP.
## API Endpoints
- `/api/tasks`: List all tasks (GET)
- `/api/tasks/{task_id}`: Retrieve a single task by ID (GET)
- `/api/tasks`: Create a new task (POST)
- `/api/tasks/{task_id}`: Update an existing task by ID (PUT)
- `/api/tasks/{task_id}`: Delete a task by ID (DELETE)## Conclusion
You've successfully run a Python application. Feel free to make changes to the application and deploy it to your preferred environment.