ExamFlow is a powerful, creative, and multipurpose online examination system built with Django and MySQL-compatible databases. It features a polished UI, a robust exam engine, and a custom admin dashboard.
- Frontend: Bootstrap 5, Vanilla JS, Chart.js
- Backend: Python 3.10+, Django 4.2+
- Database: MySQL 8.x or TiDB Cloud with
mysqlclientorPyMySQL
- Clone or Download the Project
- Create a Virtual Environment:
python -m venv venv.\venv\Scripts\activate(Windows) - Install dependencies:
pip install -r requirements.txt - Database Setup via XAMPP or TiDB Cloud:
- Open XAMPP Control Panel, start Apache and MySQL.
- Go to phpMyAdmin and create a database named
examflow_dbwithutf8mb4_unicode_cicollation. - In the project root, copy
.env.exampleto.envand adjust the DB credentials if needed:SECRET_KEY='change-this-secret-key' DEBUG=True DB_ENGINE='mysql' DB_NAME='examflow_db' DB_USER='root' DB_PASSWORD='' # Set this to your actual password if MySQL uses one DB_HOST='127.0.0.1' DB_PORT='3306' - For TiDB Cloud, use the connection values from the cluster connect dialog. If your TiDB setup requires TLS CA validation, also set:
DB_SSL_MODE='VERIFY_IDENTITY' DB_SSL_CA_PATH='/absolute/path/to/ca.pem'
- Run Migrations:
python manage.py makemigrationspython manage.py migrate - Seed Initial Data (Admin & Sample Exams):
python manage.py seed_dataThis creates an admin (admin321/admin@$321), a student (student/student), and sample questions. - Run the Server:
python manage.py runserver
Use the included Render setup files to deploy this project publicly.
- Push this repository to GitHub.
- Create a TiDB Cloud cluster and database.
- In TiDB Cloud, copy the MySQL connection values for host, port, database, username, and password.
- On Render, create a new Web Service from your GitHub repo.
- Render should use:
- Build Command:
./build.sh - Start Command:
gunicorn examflow.wsgi:application
- Build Command:
- Add these environment variables in Render:
SECRET_KEY: generate a strong random valueDEBUG:FalseALLOWED_HOSTS: your Render hostname, or*if you want to keep it openCSRF_TRUSTED_ORIGINS: your Render URL, for examplehttps://your-service.onrender.comDB_ENGINE:mysqlDB_NAME,DB_USER,DB_PASSWORD,DB_HOST,DB_PORT: from TiDBDB_SSL_MODE:VERIFY_IDENTITYwhen required by your TiDB clusterDB_SSL_CA_PATH: path to the uploaded TiDB CA certificate if you use one
- Deploy. The build script will collect static files, run migrations, and seed the default admin.
After the first successful deploy, log in with:
- Username:
admin321 - Password:
admin@$321
- Commit
.env.example, not.env. - Do not commit
venv/,db.sqlite3, generatedstaticfiles/, uploadedmedia/content, or Python cache folders. - If you want sample screenshots in the repository, add them intentionally instead of committing the whole
media/directory.
The project is configured for MySQL by default. If mysqlclient is not available, the project can still work with PyMySQL because init.py installs it as a MySQLdb-compatible backend.
(Add screenshots here)