mirror of
https://github.com/Doctorado-ML/beflask.git
synced 2025-08-16 07:35:51 +00:00
Config template
This commit is contained in:
BIN
app/app.db
BIN
app/app.db
Binary file not shown.
@@ -1,8 +1,10 @@
|
|||||||
import os
|
import os
|
||||||
|
import dotenv
|
||||||
from benchmark.utils import Files
|
from benchmark.utils import Files
|
||||||
from flask import (
|
from flask import (
|
||||||
Blueprint,
|
Blueprint,
|
||||||
render_template,
|
render_template,
|
||||||
|
current_app,
|
||||||
url_for,
|
url_for,
|
||||||
flash,
|
flash,
|
||||||
redirect,
|
redirect,
|
||||||
@@ -56,7 +58,10 @@ def set_benchmark(benchmark_id):
|
|||||||
@main.route("/config")
|
@main.route("/config")
|
||||||
@login_required
|
@login_required
|
||||||
def config():
|
def config():
|
||||||
return render_template("config.html")
|
os.chdir(current_user.benchmark.folder)
|
||||||
|
env = dotenv.dotenv_values(".env")
|
||||||
|
print(env)
|
||||||
|
return render_template("config.html", config_env=env)
|
||||||
|
|
||||||
|
|
||||||
@main.route("/login", methods=["GET", "POST"])
|
@main.route("/login", methods=["GET", "POST"])
|
||||||
|
@@ -1,5 +1,22 @@
|
|||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h1>Home</h1>
|
<div class="alert alert-primary" role="alert">
|
||||||
<p>Welcome to the home page!</p>
|
<h3>Configuration</h3>
|
||||||
|
<table class="table table-stripped table-hover bg-light">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th scope="col">Key</th>
|
||||||
|
<th scope="col">Value</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for item, value in config_env.items() %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ item }}</td>
|
||||||
|
<td>{{ value }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
{% endblock content %}
|
{% endblock content %}
|
||||||
|
Reference in New Issue
Block a user