A secure online voting web application built with Django that uses face recognition and OTP authentication to verify voters before allowing them to cast their vote.
- OTP Login — Voter logs in via phone number with OTP sent through 2Factor SMS API
- Face Enrollment — Voter's face is captured and trained using OpenCV LBPH face recognizer
- Face Verification — Identity is confirmed via live face recognition before voting
- Age Eligibility Check — Automatically blocks voters under 18 years old
- Duplicate Vote Prevention — A voter can only vote once per election date
- Constituency-wise Voting — Voters only see candidates from their own constituency
- Email Confirmation — Voter receives a confirmation email after successfully casting vote
- Admin Panel — Manage users, candidates, parties, constituencies, vote dates and results
| Layer | Technology |
|---|---|
| Backend | Python, Django |
| Face Recognition | OpenCV, LBPH Face Recognizer |
| Database | MySQL |
| Frontend | HTML, CSS, Bootstrap |
| OTP Service | 2Factor SMS API |
| Gmail SMTP |
git clone https://github.com/Jewelglory/evoting-face-recognition.git cd evoting-face-recognition
pip install -r req.txt
Open MySQL and run: CREATE DATABASE smart_voting_app;
DEBUG = True DATABASES = { 'default': { 'ENGINE': 'django.db.backends.mysql', 'NAME': 'smart_voting_app', 'USER': 'root', 'PASSWORD': 'your-mysql-password', 'HOST': 'localhost', 'PORT': '3306', } } SECRET_KEY = 'your-secret-key-here' TWO_FACTOR_API_KEY = 'your-2factor-api-key' EMAIL_HOST_USER = 'your-email@gmail.com' EMAIL_HOST_PASSWORD = 'your-app-password'
python manage.py migrate
python manage.py runserver
- Voter registers with name, email, phone, voter ID and constituency
- Voter logs in using phone number — OTP is sent via SMS
- Voter enrolls their face (100 face samples captured via webcam)
- On voting day, face is verified live against enrolled data
- If verified and age ≥ 18, voter can cast their vote
- Confirmation email is sent after voting
- Admin controls result visibility
URL: /admin/login/ Username: admin Password: admin
Jewel Christanand Pisse Alliance University, Bengaluru
