TriGuard Auth: Face + OTP Login System with Liveness Detection | Django Final Year Project with Source Code
Back to ProjectOkay, let's get this running on your laptop. Grab some chai. The whole thing takes about 30 to 45 minutes, and most of that is just waiting for packages to download.
python -m venv venv
venv\Scripts\activate
On macOS or Linux, use source venv/bin/activate instead. You'll see (venv) at the start of your terminal line once it's active.
pip install --upgrade pip
pip install cmake
pip install dlib-bin
pip install face_recognition
pip install -r requirements.txt
On Linux, run sudo apt install build-essential cmake libopenblas-dev liblapack-dev before this. On macOS, run brew install cmake.
copy .env.example .env
(Use cp on macOS or Linux.)
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
Copy the output and paste it into .env as FERNET_KEY. While you're in there, set SECRET_KEY to any long random string and keep DB_ENGINE=sqlite.
EMAIL_BACKEND=django.core.mail.backends.console.EmailBackend
Want real emails? Fill in EMAIL_HOST=smtp.gmail.com, your Gmail address, and a Gmail App Password (not your normal password). Leave SMS_ENABLED=False unless you have Twilio credentials.
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver
http://127.0.0.1:8000/accounts/register/, create an account, and allow camera access when the browser asks. Follow the prompts to capture your face from a few angles.http://127.0.0.1:8000/accounts/login/ and log in. After the password step, the webcam opens and you should get a challenge like "Blink twice".http://127.0.0.1:8000/admin-dashboard/ to see the charts and audit data.pytest to confirm the test suite passes.pip uninstall dlib, then pip install dlib-bin. Or install Visual Studio Build Tools with the "Desktop development with C++" workload and try again.127.0.0.1 or localhost, since browsers block camera access on plain HTTP from other addresses. Also close Zoom, Teams or anything else using the camera, and check the camera permission icon in the address bar.FERNET_KEY is missing or got pasted with extra spaces or quotes. Generate a fresh one and paste it cleanly.Still stuck? Reach out to CodeAj setup support and we'll sort it out on a call.
Our team is here to assist you with installation and setup.