rajibweb

Rajib Sunar - Portfolio (Django backend)

Your existing design, now connected to a Django backend.

What the backend does

More features

All forms use the same protection: CSRF, server-side validation, a honeypot field, per-IP rate limiting and (optional) Turnstile.

Run it on your computer

python -m venv venv
venv\Scripts\activate            # Windows   (Mac/Linux: source venv/bin/activate)
pip install -r requirements.txt
python manage.py migrate
python manage.py seed_data       # loads your current projects, skills, services
python manage.py createsuperuser # your admin login
python manage.py runserver

Open http://127.0.0.1:8000/ and http://127.0.0.1:8000/admin/

Images: copy your img folder files into static/img/ (see the note in that folder).

Email notifications

Without settings, emails are printed in the terminal (development). To receive real emails, set EMAIL_HOST_USER and EMAIL_HOST_PASSWORD (a Gmail App Password, not your normal password) - see .env.example. Messages are always saved in the admin even if email fails.

Real CAPTCHA (optional, free)

Create a Cloudflare Turnstile widget, then set TURNSTILE_SITE_KEY and TURNSTILE_SECRET_KEY. The verification box then appears on the form and is checked on the server.

Deploy (Render / Railway / PythonAnywhere)

  1. Set the environment variables from .env.example (DJANGO_DEBUG=False, a real DJANGO_SECRET_KEY, your domain in DJANGO_ALLOWED_HOSTS).
  2. Build: pip install -r requirements.txt && python manage.py collectstatic --noinput && python manage.py migrate
  3. Start: gunicorn config.wsgi
  4. Uploaded files (gallery, CV) need persistent storage or a cloud bucket on most hosts.
  5. For PostgreSQL set DB_ENGINE=postgres and the DB_* variables (also pip install psycopg[binary]).

Tests

python manage.py test