Diff between 6a9bf712afa55ef399c25492c7a967dc644ccb44 and 3d2ecf3d148069ba72da9d81b030d7cecb459711

Changed Files

File Additions Deletions Status
.gitignore +2 -1 modified
README.md +12 -0 modified
app.py +6 -1 modified
requirements.txt +1 -0 modified

Full Patch

diff --git a/.gitignore b/.gitignore
index b8e4bfe..43ff6ce 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,2 +1,3 @@
 /.venv
-__pycache__/
\ No newline at end of file
+__pycache__/
+.env
\ No newline at end of file
diff --git a/README.md b/README.md
index 1395b59..3ee97a5 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,15 @@
 Fast webview using pygit2 (lib2git) bindings. For my personal use, for now
 
 <img width="1280" height="960" alt="image" src="https://github.com/user-attachments/assets/1ce40e5f-1eed-4085-a1b4-698aac9c557f" />
+
+## Setup
+
+1. Install dependencies
+
+   ```bash
+   pip install -r requirements.txt
+   ```
+
+2. Set the `GIT_REPO_PATH` in .env
+
+...
\ No newline at end of file
diff --git a/app.py b/app.py
index 79af3c8..d2fad78 100644
--- a/app.py
+++ b/app.py
@@ -1,5 +1,7 @@
+import os
 from flask import Flask, render_template, request
 from datetime import datetime
+from dotenv import load_dotenv
 
 from git.repo import get_bare_repos
 from git.commit import get_commits, get_commit
@@ -10,8 +12,12 @@ from git.misc import get_version
 from git.diff import get_diff
 from git.blame import get_blame
 
+load_dotenv()
+
 app = Flask(__name__)
 
+repo_path = os.getenv('GIT_REPO_PATH')
+
 def datetime_filter(value, format='%Y-%m-%d %H:%M:%S'):
     if isinstance(value, datetime):
         # format regular datetime 
@@ -25,7 +31,6 @@ def datetime_filter(value, format='%Y-%m-%d %H:%M:%S'):
 
 app.jinja_env.filters['datetime'] = datetime_filter
 
-repo_path = "/home/lhietala/git-webview/repos-example"
 @app.route("/")
 def index():
     repos = get_bare_repos(repo_path)
diff --git a/requirements.txt b/requirements.txt
index 5d71ef0..1da7394 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -9,4 +9,5 @@ MarkupSafe==3.0.3
 packaging==25.0
 pycparser==2.23
 pygit2==1.19.0
+python-dotenv==1.2.1
 Werkzeug==3.1.3