Documentation Index
Fetch the complete documentation index at: https://mintlify.com/OluwagbeminiyiA/agro_pulse-API/llms.txt
Use this file to discover all available pages before exploring further.
AgroPulse uses python-decouple to read configuration values. When you start the server, python-decouple looks for a .env file in the project root and falls back to system environment variables if no file is present. You must supply all required variables before running migrations or starting the server.
Django settings
| Variable | Description | Required |
|---|
DJANGO_SECRET_KEY | Django cryptographic secret key used for signing sessions and tokens | Yes |
DEBUG | Set to True for local development, False in production | No (default: False) |
ALLOWED_HOSTS | Comma-separated list of hostnames the server may serve (e.g. localhost,127.0.0.1) | Yes |
CORS_ALLOWED_ORIGINS | Comma-separated list of origins allowed to make cross-site requests | Yes |
Database
AgroPulse uses PostgreSQL exclusively. SQLite is not supported.
| Variable | Description | Default |
|---|
DB_NAME | PostgreSQL database name | — |
DB_USER | PostgreSQL user | — |
DB_PASSWORD | PostgreSQL password | — |
DB_HOST | PostgreSQL host | localhost |
DB_PORT | PostgreSQL port | 5432 |
Email
AgroPulse sends OTP verification emails via SMTP. The settings below configure the Gmail SMTP backend used by default.
| Variable | Description |
|---|
EMAIL_SENDER | The Gmail address used as From in outgoing mail and as the OTP sender |
EMAIL_PASSWORD | The Gmail app password for the sender account |
EMAIL_HOST is hardcoded to smtp.gmail.com, EMAIL_PORT to 587, and EMAIL_USE_TLS to True in settings.py. You do not need to set these in your .env file.
OTP settings
| Variable | Description |
|---|
OTP_EMAIL_THROTTLE_FACTOR | Controls OTP throttling (seconds between requests) |
OTP_EMAIL_COOLDOWN_DURATION | Cooldown period after multiple OTP failures |
OTP_EMAIL_TOKEN_VALIDITY | How long (in seconds) an OTP token remains valid |
Squad payment gateway
AgroPulse processes payments through the Squad payment gateway. All five variables are required for payment initiation, verification, escrow, and payout to work.
| Variable | Description |
|---|
SQUAD_SECRET_KEY | Your Squad API secret key |
SQUAD_PUBLIC_KEY | Your Squad API public key |
SQUAD_MERCHANT_ID | Your Squad merchant ID |
SQUAD_BASE_URL | Squad API base URL. Sandbox: https://sandbox-api-d.squadco.com |
SQUAD_PAYMENT_URL | Squad payment initiation endpoint URL |
Sample .env file
# Django
DJANGO_SECRET_KEY=your-django-secret-key-here
DEBUG=True
ALLOWED_HOSTS=localhost,127.0.0.1
CORS_ALLOWED_ORIGINS=http://localhost:3000,http://127.0.0.1:3000
# Database
DB_NAME=agropulse
DB_USER=agropulse_user
DB_PASSWORD=your-db-password
DB_HOST=localhost
# Email
EMAIL_SENDER=[email protected]
EMAIL_PASSWORD=your-gmail-app-password
# OTP
OTP_EMAIL_THROTTLE_FACTOR=1
OTP_EMAIL_COOLDOWN_DURATION=300
OTP_EMAIL_TOKEN_VALIDITY=300
# Squad payment gateway
SQUAD_SECRET_KEY=sk_test_your_squad_secret_key
SQUAD_PUBLIC_KEY=pk_test_your_squad_public_key
SQUAD_MERCHANT_ID=your_merchant_id
SQUAD_BASE_URL=https://sandbox-api-d.squadco.com
SQUAD_PAYMENT_URL=https://sandbox-api-d.squadco.com/transaction/initiate
Never commit your .env file to version control. Add .env to your .gitignore before making your first commit.
Celery and Redis
If you use Celery for asynchronous task processing, add the following variable. Celery and Redis are included as dependencies in pyproject.toml.
| Variable | Description | Example |
|---|
CELERY_BROKER_URL | Connection URL for the Celery message broker | redis://localhost:6379/0 |