Django web app for student ID application, approval, verification, and PDF card download.
- Public ID application form
- Admin review workflow (Pending/Approved/Rejected)
- QR code generation for verification URLs
- Public verification endpoint
- PDF ID card generation
- Python
- Django
- Pillow
- qrcode
- reportlab
cpi_id/Django project settings and root URLsidcards/Main app (models, views, forms, admin)templates/Shared templatesidcards/templates/idcards/App templatesstatic/Source static assetsmedia/Runtime uploads (ignored in git)
- Create venv:
python -m venv .venv- Install dependencies:
.\.venv\Scripts\python -m pip install --upgrade pip
.\.venv\Scripts\python -m pip install -r requirements.txt- Run migrations:
.\.venv\Scripts\python manage.py migrate- Create admin user:
.\.venv\Scripts\python manage.py createsuperuser- Start server:
.\.venv\Scripts\python manage.py runserverCopy .env.example values into your deployment environment.
Important variables:
DJANGO_SECRET_KEYDJANGO_DEBUGDJANGO_ALLOWED_HOSTSDJANGO_CSRF_TRUSTED_ORIGINSDJANGO_SECURE_SSL_REDIRECTDJANGO_CSRF_COOKIE_SECUREDJANGO_SESSION_COOKIE_SECURE
- Set
DJANGO_DEBUG=False. - Set a strong
DJANGO_SECRET_KEY. - Set correct
DJANGO_ALLOWED_HOSTSandDJANGO_CSRF_TRUSTED_ORIGINS. - Run
collectstaticbefore deployment:
.\.venv\Scripts\python manage.py collectstatic --noinput- Confirm
.gitignoreis present (venv, db, media, env files are ignored). - Do not commit
.envor production secrets. - Initialize git (if needed), then commit:
git init
git add .
git commit -m "Initial commit"- Add GitHub remote and push:
git remote add origin <your-repo-url>
git branch -M main
git push -u origin main