A comprehensive Django package providing ISO data, currencies, and administrative subdivisions (provinces/regions) for all African countries. Includes both static choices and database models.
# django-africa-countries 🌍
A comprehensive Django package providing ISO data, currencies, and administrative subdivisions (provinces/regions) for all 54 African countries.
## ✨ Features
- **Hybrid Data Access**: Use static Python choices (no database required) or full Django Models for relational data.
- **Complete African Scope**: Detailed data for all 54 countries (ISO 3166-1, Calling Codes, Currencies, Capitals).
- **Subdivisions**: Accurate administrative regions (Provinces, States, Regions) based on ISO 3166-2.
- **Smart Fields**:
- `AfricaCountryField`: A specialized select field for African nations.
- `AfricaProvinceField`: A dependent field that filters provinces based on the selected country (with built-in AJAX for Django Admin).
- **Internationalization (i18n)**: Built-in translations for French, English, Arabic, and Portuguese.
---
## 🚀 Roadmap (The 4 Sprints)
We are currently building this package following a strict sprint-based approach:
- [ ] **Sprint 1**: Foundations & Data (JSON Source of Truth & Project Structure).
- [ ] **Sprint 2**: Static Mode & Helpers (Accessing data via Python constants/tuples).
- [ ] **Sprint 3**: Dynamic Mode & Models (Database Integration, Migrations, and Auto-load commands).
- [ ] **Sprint 4**: UI Components & Smart Fields (Admin Enhancement & JavaScript integration).
---
## 🛠 Installation (Coming Soon)
Once published, install via pip:
```bash
pip install django-africa-countries
```
Ajoutez ensuite africa_countries à votre liste INSTALLED_APPS dans votre fichier settings.py :
```bash
INSTALLED_APPS = [
...,
'africa_countries',
]
```
## Quick Usage Examples
1. Mode Statique (Pas de migration nécessaire)
Idéal pour des formulaires simples sans impacter la base de données.
```bash
from africa_countries.choices import AFRICAN_COUNTRIES_CHOICES
class SignupForm(forms.Form):
country = forms.ChoiceField(choices=AFRICAN_COUNTRIES_CHOICES)
```
2. Mode Modèle (Relationnel)
Pour lier vos données avec des clés étr …