Posts

Showing posts from December, 2024

A Complete Tutorial: Using RabbitMQ + Celery with Multiple Django Projects

In this post, we’ll walk through how to set up RabbitMQ on one server and run Celery across multiple Django projects, with clean project isolation, scalable architecture, and best practices. ✅ Step 1: Install RabbitMQ (Server A) ➡️ On Ubuntu (Server A): sudo apt update sudo apt install rabbitmq-server -y sudo systemctl enable rabbitmq-server sudo systemctl start rabbitmq-server ➡️ Enable RabbitMQ Management UI: sudo rabbitmq-plugins enable rabbitmq_management Visit: http://server-a-ip:15672 (default guest/guest). ➡️ Create RabbitMQ User: sudo rabbitmqctl add_user admin strongpasswordhere sudo rabbitmqctl set_user_tags admin administrator sudo rabbitmqctl set_permissions -p / admin ".*" ".*" ".*" sudo rabbitmqctl delete_user guest # For security ➡️ Open Ports: 5672 (for Celery workers) 15672 (for admin UI, restricted IPs recommended) ✅ Step 2: Project Structure (Multiple Django Projects Example) /var/www/ ├── project_...

How to Install and Manage PostGIS with a Non-Superuser Role

Image
Prerequisite: PostgreSQL Version This guide assumes you are using PostgreSQL version 14 or later, which supports the necessary commands for PostGIS installation and management. Ensure your PostgreSQL server is up-to-date before proceeding. This guide ensures that PostGIS is installed and configured properly for a specific user, such as administrator , while avoiding common issues. 1. Ensure Superuser Access sudo -i -u postgres psql --dbname=financethat 2. Create a Role for PostGIS Management CREATE ROLE administrator WITH LOGIN PASSWORD 'your_secure_password'; GRANT ALL PRIVILEGES ON DATABASE financethat TO administrator; 3. Install PostGIS To install PostGIS on Ubuntu, first ensure you have the required PostgreSQL version installed. Then, use the following commands: sudo apt update sudo apt install postgis postgresql-14-postgis-3 Replace 14 with your PostgreSQL version if different. After installation, enable PostGIS in...