python3 -m venv venv
python3 -m pip install -r requirements.txt
- Run
python3 manage.py runserver
once to create a database.
- Quit the process and run:
python3 manage.py shell
to add some Roles and Users run:
from app import db
from app.models import User, Role
employee_role = Role(name = 'employee')
supervisor_role = Role(name = 'supervisor')
hr_role = Role(name = 'hr')
user_test_1 = User(email = '[email protected]', password = 'password', full_name = 'Max Mustermann', role=employee_role)
user_test_2 = User(email = '[email protected]', password = 'password', full_name = 'John Doe', role=supervisor_role)
user_test_3 = User(email = '[email protected]', password = 'password', full_name = 'Anita John', role=hr_role)
db.session.add_all([employee_role, supervisor_role, hr_role, user_test_1, user_test_2,user_test_3])
db.session.commit()
- After that you can quit the shell by running
quit()
- to run the application run:
python3 manage.py runserver
again.
- Run the tests by typing
pytest
in your terminal.