A structured, collaborative, and transparent digital environment built with Django and Wagtail CMS where researchers, practitioners, and institutions can access and manage standardized information on methods and indicators used to measure progress in climate change adaptation.
TrackAdapt Wiki provides a comprehensive platform for documenting and sharing climate adaptation strategies, methodologies, and indicators. The system integrates with Keycloak for unified authentication and uses Google reCAPTCHA for form security.
- Python 3.10+
- Django 5.2.7
- Wagtail 7.2.1
- PostgreSQL 12+ (production)
- Keycloak 25.0+ (authentication)
- Node.js (for static assets compilation)
- Backend Framework: Django 5.2.7
- CMS: Wagtail 7.2.1
- Database: PostgreSQL (production), SQLite (development)
- Authentication: Mozilla Django OIDC + Keycloak
- Web Server: Gunicorn + Nginx (production)
- Security: Google reCAPTCHA v2
- Email: Gmail SMTP
- Analytics: Google Analytics 4
git clone https://github.com/CIAT-DAPA/wiki_for_adaptation.git
cd wiki_for_adaptationpython -m venv env
# On Linux/macOS
source env/bin/activate
# On Windows
env\Scripts\activatecd src/mysite
pip install -r requirements.txtCreate a .env file in the repository root with the following variables:
# Django Settings
DJANGO_SETTINGS_MODULE=mysite.settings.production
SECRET_KEY=your-secret-key-here
DEBUG=False
ALLOWED_HOSTS=trackadapt.org,www.trackadapt.org
# Database (PostgreSQL for production)
DATABASE_URL=postgresql://user:password@localhost:5432/dbname
# Email Configuration (Gmail SMTP)
EMAIL_HOST_USER=your-email@gmail.com
EMAIL_HOST_PASSWORD=your-gmail-app-password
DEFAULT_FROM_EMAIL=your-email@gmail.com
# Keycloak OIDC Configuration
PUBLIC_KEYCLOAK_URL=https://auth.trackadapt.org
PUBLIC_KEYCLOAK_REALM=trackadapt
PUBLIC_KEYCLOAK_CLIENT_ID=trackadapt_admin
KEYCLOAK_CLIENT_SECRET=your-keycloak-client-secret
# Google Services
GOOGLE_ANALYTICS_ID=G-XXXXXXXXXX
RECAPTCHA_PUBLIC_KEY=your-recaptcha-site-key
RECAPTCHA_PRIVATE_KEY=your-recaptcha-secret-keyIf starting from scratch without migrations and database:
cd src/mysite
# Create migrations
python manage.py makemigrations
# Apply migrations
python manage.py migrate
# Create a superuser
python manage.py createsuperuser
# Collect static files
python manage.py collectstatic --no-input
# Run development server
python manage.py runserverThe application will be available at: http://localhost:8000
Note: If you encounter circular dependency errors during makemigrations, you may need to migrate models individually by temporarily commenting out dependent models in models.py files.
If the project includes migrations and a database:
cd src/mysite
python manage.py runserverThe production deployment uses Gunicorn as the WSGI server:
cd wiki_for_adaptation
# Restart Gunicorn service
bash restart_gunicorn.shFor initial production setup, ensure:
- PostgreSQL database is created
.envfile is configured with production values- Static files are collected:
python manage.py collectstatic --no-input - Migrations are applied:
python manage.py migrate - Nginx is configured as reverse proxy
python manage.py createsuperuser- Wagtail Admin:
http://localhost:8000/admin/ - Django Admin:
http://localhost:8000/django-admin/
- Create a realm named
trackadapt - Create a client with ID
trackadapt_admin - Configure redirect URIs:
https://trackadapt.org/oidc/callback/ - Enable reCAPTCHA in registration flow (optional)
- Copy client secret to
.envfile
wiki_for_adaptation/
βββ src/mysite/ # Django project root
β βββ mysite/ # Project settings
β β βββ settings/
β β β βββ base.py # Base settings
β β β βββ dev.py # Development settings
β β β βββ production.py # Production settings
β β βββ templates/ # Global templates
β β βββ static/ # Global static files
β β βββ urls.py # URL configuration
β β βββ views.py # Custom views (forms, emails)
β β βββ wsgi.py # WSGI application
β βββ home/ # Home app (static pages)
β β βββ models.py # Page models
β β βββ templates/ # Page templates
β βββ catalog/ # Catalog app (main content)
β βββ search/ # Search functionality
β βββ manage.py # Django management script
β βββ requirements.txt # Python dependencies
βββ wiki-login-theme/ # Keycloak custom theme
β βββ login/ # Login pages customization
βββ logs/ # Application logs (production)
βββ restart_gunicorn.sh # Gunicorn restart script
βββ Jenkinsfile # CI/CD pipeline configuration
βββ .env # Environment variables (not in git)
βββ README.md # This file
- π Content Management: Wagtail CMS for structured content editing
- π Single Sign-On: Keycloak integration for unified authentication
- π Advanced Search: Full-text search across all content
- π§ Email Notifications: Automated emails for feedback and editor applications
- π Analytics: Google Analytics 4 integration
- π SEO Optimized: Meta tags and structured data for all pages
- π¨ Responsive Design: Mobile-friendly interface
- π₯ User Management: Role-based access control
The project uses Jenkins for CI/CD with the following pipeline stages:
- Build: Install dependencies
- Test: Run test suite
- Migrate: Apply database migrations
- Collect Static: Gather static files
- Deploy: Restart Gunicorn service
# On production server
cd /opt/goodall/wiki_for_adaptation
# Pull latest changes
git pull origin main
# Activate virtual environment
source env/bin/activate
# Install/update dependencies
pip install -r src/mysite/requirements.txt
# Apply migrations
cd src/mysite
python manage.py migrate
# Collect static files
python manage.py collectstatic --no-input
# Restart Gunicorn
cd ../..
bash restart_gunicorn.shThis project is part of the CGIAR initiative for climate change adaptation research.
For issues and questions:
- Email: trackadaptwiki@gmail.com
- Website: https://trackadapt.org