IsaacKerson commited on
Commit
2bd90e8
1 Parent(s): 02bfc9a

connect login page to db

Browse files
Files changed (3) hide show
  1. authenticator.py +0 -2
  2. pages/login.py +8 -0
  3. pages/utils.py +0 -1
authenticator.py CHANGED
@@ -5,8 +5,6 @@ import streamlit as st
5
  from datetime import datetime, timedelta
6
  import extra_streamlit_components as stx
7
 
8
- # _RELEASE = True
9
-
10
  class Hasher:
11
  def __init__(self, passwords):
12
  """Create a new instance of "Hasher".
 
5
  from datetime import datetime, timedelta
6
  import extra_streamlit_components as stx
7
 
 
 
8
  class Hasher:
9
  def __init__(self, passwords):
10
  """Create a new instance of "Hasher".
pages/login.py CHANGED
@@ -8,6 +8,14 @@ from pages.utils import *
8
 
9
  def app():
10
 
 
 
 
 
 
 
 
 
11
  yamel_path = db_path('config.yaml')
12
 
13
  with open(yamel_path) as file:
 
8
 
9
  def app():
10
 
11
+ DATATBASE = db_path('quiz_maker')
12
+ c, conn = db_connect(DATABASE)
13
+ query = "SELECT * FROM users"
14
+ for item in c.execute(query):
15
+ st.write("item")
16
+ conn.commit()
17
+ conn.close()
18
+
19
  yamel_path = db_path('config.yaml')
20
 
21
  with open(yamel_path) as file:
pages/utils.py CHANGED
@@ -32,7 +32,6 @@ def make_query(subquery, limit = 10):
32
  return f"""SELECT * FROM vocab WHERE {subquery} ORDER BY RANDOM() LIMIT {str(limit)}"""
33
 
34
  def db_path(database):
35
- # DATABASE_NAME = 'quiz_maker.db'
36
  dir = os.path.dirname(os.path.abspath(__file__))
37
  return os.path.join(dir, database)
38
 
 
32
  return f"""SELECT * FROM vocab WHERE {subquery} ORDER BY RANDOM() LIMIT {str(limit)}"""
33
 
34
  def db_path(database):
 
35
  dir = os.path.dirname(os.path.abspath(__file__))
36
  return os.path.join(dir, database)
37