REST API for Tanzania tourism. Built with Django.
Xenohuru is an open platform for Tanzania tourism data — attractions, regions, weather, tour operators and more. The name comes from "xenos" (explorer in Greek) + "huru" (free in Swahili).
This is the backend API. There's a separate frontend repo.
- Django 4.2 + Django REST Framework
- PostgreSQL
- JWT auth (djangorestframework-simplejwt)
- Cloudinary for media
- Open-Meteo for weather (free, no API key needed)
- Python 3.10+
- PostgreSQL (or SQLite for quick testing)
git clone https://github.com/xenohuru/xenohuru-core.git
cd xenohuru-core
python -m venv venv
source venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
# edit .env with your values
python manage.py migrate
python manage.py runserverAPI will be at http://localhost:8000/api/v1/
Swagger docs at http://localhost:8000/api/docs/
Admin at http://localhost:8000/admin/
cp .env.example .env
# edit .env with your values
docker compose up --buildThis builds the app image, starts Postgres, runs migrations, and serves
the app on http://localhost:8000/. Static files and app logs persist in
named Docker volumes (docker compose logs web for live output).
See .env.example. Key ones:
SECRET_KEY=
DEBUG=True
DB_NAME=, DB_USER=, DB_PASSWORD=, DB_HOST=, DB_PORT=
CLOUDINARY_CLOUD_NAME=, CLOUDINARY_API_KEY=, CLOUDINARY_API_SECRET=
EMAIL_HOST_USER=, EMAIL_HOST_PASSWORD=
FRONTEND_URL=
GET /api/v1/attractions/ list attractions
GET /api/v1/attractions/<slug>/ attraction detail
GET /api/v1/regions/ list regions
GET /api/v1/operators/ tour operators
GET /api/v1/weather/current/ current weather (pass lat/lng or slug)
POST /api/v1/auth/register/ create account
POST /api/v1/auth/login/ get JWT token
POST /api/v1/feedback/submit/ contact / feedback form
POST /api/v1/feedback/attractions/<slug>/reviews/ submit a review
Full endpoint list in the Swagger docs.
pip install -r requirements-dev.txt
ruff check .
python manage.py testJenkins (Jenkinsfile) lints, builds the Docker image, and runs migrations
and the test suite against it on every push; main deploys automatically
once tests pass, via docker compose up -d --build on the production host.
python manage.py loaddata initial_regions
python manage.py loaddata initial_attractionsFork the repo, make your changes on a new branch, open a PR. See CONTRIBUTING.md for more details.
Xenohuru API is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License v3.0 as published by the Free Software Foundation. See LICENSE for the full text.
Built in Tanzania 🇹🇿