fix indexed sites
This commit is contained in:
parent
ccdd13a188
commit
0ca6a2b490
9
app.py
9
app.py
@ -17,9 +17,14 @@ def parsetime(value):
|
||||
def index():
|
||||
statement = 'SELECT "id", "name", "website", "comment", "date", "ip" FROM "entries" ORDER BY id DESC'
|
||||
cs.execute(statement)
|
||||
return render_template("index.html", comments=cs.fetchall())
|
||||
comments = cs.fetchall()
|
||||
statement = 'SELECT DISTINCT website FROM entries'
|
||||
cs.execute(statement)
|
||||
sites = cs.fetchall()
|
||||
print(sites)
|
||||
return render_template("index.html", comments=comments, sites=sites)
|
||||
|
||||
@app.route('/submit', methods=["POST"])
|
||||
@app.route('/gb/submit', methods=["POST"])
|
||||
def submit():
|
||||
errors = []
|
||||
name = request.form.get("name")
|
||||
|
@ -14,7 +14,7 @@
|
||||
<button>submit</button>
|
||||
</form>
|
||||
<hr>
|
||||
<b>Sites indexed</b>: {% for comment in comments %}<a href="http://{{comment[2]}}">{{comment[2]}}</a> {% endfor %}
|
||||
<b>Sites indexed</b>: {% for site in sites %}<a href="http://{{site[0]}}">{{site[0]}}</a> {% endfor %}
|
||||
<hr>
|
||||
{% for comment in comments %}
|
||||
<div class="comment">
|
||||
|
Loading…
Reference in New Issue
Block a user