Skip to main content

Post-Installation Setup

Create Django Admin Superuser

cd /var/www/proenergia/app
source venv/bin/activate
python manage.py createsuperuser

Configure GitHub Webhook (Optional)

Script 03 generates a webhook secret displayed at the end of its output (also saved to /var/www/proenergia/webhook_secret.txt).

  1. Go to GitHub repository → Settings → Webhooks → Add webhook.
  2. Set Payload URL to https://your-domain.com/deploy-webhook.
  3. Set Content type to application/json.
  4. Paste the webhook secret into the Secret field.
  5. Select Just the push event. Click Add webhook.

systemd Services

ServicePurpose
proenergia.serviceGunicorn WSGI application server. Serves the Django REST API.
proenergia-celery.serviceCelery worker. Processes PMTiles generation and CSV import tasks.
proenergia-celerybeat.serviceCelery Beat scheduler. Handles periodic/scheduled tasks.
proenergia-webhook.serviceWebhook listener for automated git-push deployments.
# Status and logs
sudo systemctl status proenergia
sudo journalctl -u proenergia -f
sudo journalctl -u proenergia-celery -f

# Restart after changes
sudo systemctl restart proenergia
sudo systemctl restart proenergia-celery
sudo systemctl restart proenergia-celerybeat