- A Q&A app that consists of three roles which are admin, expert, and user.
- Users post their questions and specify which expert to answer it.
- Admin has the authority to determine which user could be the expert for answering the question.
- This app doesn't use Flask-SQLALCHEMY extension.
- Create a virtual environment and install the dependencies.
pip install -r requirements.txt
- Run the following code in your terminal and input your database's name in <database's name>.
sqlite3 <database's name> < schema.sql
- Open db.py and replace question.db to your database's name in connect_db function.
sql = sqlite3.connect(os.path.join(os.path.dirname(__name__), os.path.abspath('question.db')))
- Run app.py
- Once the app is running, create a new user with name = 'admin' for administration.
- Run the following code and SQL:
sqlite3
UPDATE users SET admin = 1 WHERE name = 'admin'
- Login as admin and now you have the authority to decide which user can becomes an expert to answer the questions!