Spaces:
Running
Running
Upload folder using huggingface_hub
Browse files- app.py +6 -1
- static/favicon.svg +1 -0
- templates/index.html +1 -0
- templates/login.html +1 -0
app.py
CHANGED
|
@@ -23,7 +23,7 @@ app.wsgi_app = ProxyFix(app.wsgi_app, x_proto=1, x_host=1)
|
|
| 23 |
|
| 24 |
@app.before_request
|
| 25 |
def require_login():
|
| 26 |
-
if request.endpoint in ("login", "static"):
|
| 27 |
return
|
| 28 |
if not session.get("authenticated"):
|
| 29 |
if request.path.startswith("/api/"):
|
|
@@ -105,6 +105,11 @@ def logout():
|
|
| 105 |
return redirect(url_for("login"))
|
| 106 |
|
| 107 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 108 |
@app.route("/")
|
| 109 |
def index():
|
| 110 |
return render_template("index.html")
|
|
|
|
| 23 |
|
| 24 |
@app.before_request
|
| 25 |
def require_login():
|
| 26 |
+
if request.endpoint in ("login", "static") or request.path == "/favicon.ico":
|
| 27 |
return
|
| 28 |
if not session.get("authenticated"):
|
| 29 |
if request.path.startswith("/api/"):
|
|
|
|
| 105 |
return redirect(url_for("login"))
|
| 106 |
|
| 107 |
|
| 108 |
+
@app.route("/favicon.ico")
|
| 109 |
+
def favicon():
|
| 110 |
+
return redirect(url_for("static", filename="favicon.svg"), code=302)
|
| 111 |
+
|
| 112 |
+
|
| 113 |
@app.route("/")
|
| 114 |
def index():
|
| 115 |
return render_template("index.html")
|
static/favicon.svg
ADDED
|
|
templates/index.html
CHANGED
|
@@ -4,6 +4,7 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>oTree CSV Viewer</title>
|
|
|
|
| 7 |
<style>
|
| 8 |
:root { --bg: #0f1117; --surface: #1a1d27; --sidebar: #14161e; --border: #2a2d3a; --text: #e0e0e0; --dim: #888; --accent: #6c9bff; --accent2: #4a7adf; --green: #4caf80; --red: #e05555; --orange: #e0a030; --purple: #9b7fdf; }
|
| 9 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>oTree CSV Viewer</title>
|
| 7 |
+
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
| 8 |
<style>
|
| 9 |
:root { --bg: #0f1117; --surface: #1a1d27; --sidebar: #14161e; --border: #2a2d3a; --text: #e0e0e0; --dim: #888; --accent: #6c9bff; --accent2: #4a7adf; --green: #4caf80; --red: #e05555; --orange: #e0a030; --purple: #9b7fdf; }
|
| 10 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
templates/login.html
CHANGED
|
@@ -4,6 +4,7 @@
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Login - oTree CSV Viewer</title>
|
|
|
|
| 7 |
<style>
|
| 8 |
:root { --bg: #0f1117; --surface: #1a1d27; --border: #2a2d3a; --text: #e0e0e0; --dim: #888; --accent: #6c9bff; --accent2: #4a7adf; --red: #e05555; }
|
| 9 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|
|
|
|
| 4 |
<meta charset="UTF-8">
|
| 5 |
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 6 |
<title>Login - oTree CSV Viewer</title>
|
| 7 |
+
<link rel="icon" type="image/svg+xml" href="/static/favicon.svg">
|
| 8 |
<style>
|
| 9 |
:root { --bg: #0f1117; --surface: #1a1d27; --border: #2a2d3a; --text: #e0e0e0; --dim: #888; --accent: #6c9bff; --accent2: #4a7adf; --red: #e05555; }
|
| 10 |
* { box-sizing: border-box; margin: 0; padding: 0; }
|