Skip to content

SerAcero/python-repo-template

Repository files navigation

python-repo-template

Python project template repository using FastAPI.

Contains:

  • precommit file
  • Contains CI/CD pipelines through github workflows.
  • deployment pipelines (I tested render and to DigitalOcean).

Getting started

conda create -n your_env_name
conda install poetry

poetry install

How to run

In the terminal, from the root folder of the repository:

python -m src.__template_pkg__.api.main

Recommended Git Workflow

git clone https://github.com/you/python-repo-template.git my-project
cd my-project

After cloning this template:

  1. Remove template git history:

    rm -rf .git
    git init
    git add .
    git commit -m "Initial commit from template"
  2. Create your branches:

    git branch dev
    git branch staging
    git branch prod
  3. Set up branch protection rules (if using GitHub/GitLab)

Suggested Branching Strategy

  • main/master: Production-ready code
  • dev: Development branch
  • feature/*: Feature branches
  • hotfix/*: Emergency fixes

Deployment

On render

Render is a cloud platform that simplifies the process of building, deploying, and scaling web applications and services. https://render.com/

I tested a deployment on render render. there I had to:

  • sign in
  • create a web service
  • link to github repository
  • change service settings to deploy on last commit
  • Add environment variables through render's interface

On VPS

See VPS_deployment

About

Python project template repository

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published