Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lucaspdroz/python-fastapi-case
Sharing my learning proces
https://github.com/lucaspdroz/python-fastapi-case
Last synced: about 1 month ago
JSON representation
Sharing my learning proces
- Host: GitHub
- URL: https://github.com/lucaspdroz/python-fastapi-case
- Owner: lucaspdroz
- Created: 2024-11-01T03:32:32.000Z (about 2 months ago)
- Default Branch: main
- Last Pushed: 2024-11-04T13:30:39.000Z (about 2 months ago)
- Last Synced: 2024-11-04T14:22:03.107Z (about 2 months ago)
- Language: Python
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Python Web Study
This is not a walkthrough, I'm just sharing my learning process.
1. Familiarize with the Web Environment
I already have some knowledge of Python 3 and now need to acclimate to its use in a web context.2. Set Up a Local Server
I chose to use the "uvicorn" package due to its similarity to Node.js.3. Develop a Basic FastAPI Application
I want to create a FastAPI application that aligns with current market trends.
* Running the Project: How to run the project effectively.4. Create a Local Environment
Establishing a local environment is crucial (I've seen a lot of examples already! 😅).5. Break Down the Paths into Routes
Start with creating basic routes.6. Create More Complex Endpoints - ex: Implement POST methods for data processing and explore passing data as query parameters.
7. Security and Validation
* URL validation to prevent various types of attacks (XSS, DoS, Input Length Attacks)## Commands
### Create venv (only first-time)
Create a Virtual Environment (only on the first run)
> python3 -m venv [venv_name]
### Activate venv
Activate the Virtual Environment
> source venv/bin/activate
### Deactivate venv
Deactivate the Virtual Environment
> deactivate
### Save packages
Save Installed Packages and Versions to a File
> pip freeze > requirements.txt
### Installing requirements
Install Requirements from a File
> pip install -r requirements.txt
### Starting application
Start the Application (with auto-reload)
> uvicorn app.main:app --reload
## Husky
For better commits run [Husky](https://typicode.github.io/husky/)
> git commit -m "[commitlint-kind]: "