Skip to content

Repository files navigation

Turing Academy — Backend

REST API for the Turing Academy website, built with Django 5 and Django REST Framework. It serves events, specialities, scholarships, graduates, community, partners, contact and test endpoints, with auto-generated Swagger / ReDoc documentation.


Tech stack

  • Django 5.1 + Django REST Framework
  • drf-yasg (Swagger / ReDoc API docs)
  • Jazzmin admin theme
  • django-cors-headers, django-alive (health checks)
  • goodconf for environment-driven settings
  • Gunicorn for production

Project layout

turing_back/
├── config.py              # env-driven settings (goodconf)
├── settings/
│   ├── base.py            # shared settings
│   ├── dev.py             # DEBUG, open CORS, console logging
│   └── prod.py            # security hardening, env hosts/CORS, optional Postgres
├── urls.py                # root urlconf (admin, health, /api/)
└── apps/api/
    ├── urls.py            # Swagger/ReDoc + /v1/
    └── v1/                # versioned API
        ├── event/ partner/ general/ graduate/ community/
        ├── speciality/ schoolarship/ test_and_contact/
        └── urls.py

Quick start (development)

# 1. Install deps (Poetry or pip)
poetry install            # or: pip install -r requirements.txt

# 2. Configure
cp .env.example .env      # then edit values

# 3. Migrate & run
python manage.py migrate
python manage.py createsuperuser
python manage.py runserver

The dev/prod settings module is selected automatically from turing_back_debug (see config.py).

API documentation

Once running:

  • Swagger UI — /api/swagger/
  • ReDoc — /api/doc/
  • Health check — /-/health/

List endpoints are paginated (?page=, 20 items per page) and rate-limited (60/min anonymous, 1000/day authenticated).

Configuration

All settings come from the environment (prefixed turing_back_) or a .env file — no secrets are committed. See .env.example for the full list. Production additionally reads DJANGO_ALLOWED_HOSTS, DJANGO_CSRF_TRUSTED_ORIGINS, DJANGO_CORS_ALLOWED_ORIGINS and the optional DB_* PostgreSQL variables directly from the environment.

Make targets

make run        # dev server
make migrate    # apply migrations
make test       # run tests
make prod       # gunicorn
make check      # flake8 + black + bandit

Deployment

setup.sh provisions an Ubuntu host end to end (system packages, virtualenv, migrations, Gunicorn systemd socket/service, Nginx and optional Certbot SSL). It assumes Nginx (not Apache). Review it before running on a real server.

License

MIT — see LICENSE. Built by Qiyas CC, based on django-layout.

About

REST API backend for Turing Academy — Django 5 + DRF, versioned API, Swagger/ReDoc docs, Jazzmin admin, env-driven config.

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages