This website demonstrates keystroke dynamics as an alternative MFA other than the popular OTP or push notification MFAs.
- Create a database called
Soteria
(you can use any name of your choice). - Modify the
settings.py
file with your newly created database name, user, host and password.DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'soteria', # Set DB Name 'HOST': 'localhost', 'PORT': '3306', 'USER': 'root', 'PASSWORD': '*****', # Set DB password }}
- Visit Sendgrid to create an account for sending email.
- Follow the guide here on how to set up a new api key.
- Modify the code below in the
settings.py
file with your sendgrid account details such as email, api key and password.# Email settings DEFAULT_FROM_EMAIL = '[email protected]' SERVER_EMAIL = '[email protected]' EMAIL_USE_TLS = True EMAIL_HOST = 'smtp.sendgrid.net' EMAIL_PORT = 587 EMAIL_HOST_USER = 'apikey' EMAIL_HOST_PASSWORD = '***************************'
- Visit Twilio and create an account to get an assigned phone number for sending SMS.
- Modify the
view.py
file with your account_sid, auth_token, and assigned phone number (change from+13233363926
to yours). You can find the information on your twilio dashboard.def sendSMS(message, phone): if '+' not in str(phone): phone = '+1' + str(phone) account_sid = '*******************************' auth_token = '*******************************' client = Client(account_sid, auth_token) client.messages.create(to=phone, from_='+13233363926', body=message)
- House is clean!
Use the package manager pip to install all required packages.
pip install -r requirements.txt
Allow django to automatically create the database tables using manage.py
. This should run successfully if all the House keeping
instructions above are followed.
python manage.py makemigrations
python manage.py migrate
Upon a successful migration, you can now run the server. The server should run on http://127.0.0.1:8000
.
python manage.py runserver
Steps to follow for a successful interaction with the website.
- Complete Signup.
- Login.
- Attempt account recovery (forgot password)
Feel free to make changes to the code.