Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/mrbrazzi/my_django_celery_stack

Stack of containers with Celery application based in Django, Celery Worker, Celery Beat and RabbitMQ
https://github.com/mrbrazzi/my_django_celery_stack

Last synced: about 2 months ago
JSON representation

Stack of containers with Celery application based in Django, Celery Worker, Celery Beat and RabbitMQ

Awesome Lists containing this project

README

        

# My Stack
Implementation of Producer-Consumer using Docker containers with Django App, Celery Worker & Beat and RabbitMQ.

## How to setup initial configurations

### Setup database configuration
Make a copy of .env-sample
```bash
cp .env-sample .env
```

Setup database configuration. Update values for:
```ini
DB_NAME=
```

### Setup Celery configuration
In file **.env**, created before when *[setup database configuration](#setup-database-configuration)*; update values for:
```ini
# RABBITMQ
BROKER_USER=
BROKER_PASSWORD=
BROKER_HOST=
BROKER_PORT=

# CELERY
CELERY_TASK_DEFAULT_QUEUE=
CELERY_TASK_DEFAULT_EXCHANGE=
CELERY_TASK_DEFAULT_ROUTING_KEY=
```

### Start the stack with Docker
From root directory execute:
```
docker-compose -f .container/docker-compose up -d
```

### Using RabbitMQ Manager tool
[Start the stack with Docker](#start-the-stack-with-docker)

Visit url http://localhost:15672/
```
username: rabbitmq_admin
password: RabbitMqAdminPassWord
```

#### Create user for Celery Worker and Celery Beat
Login in [RabbitMQ Manager Tool](#using-rabbitmq-manager-tool)

Click in **Admin** menu option

Click in **Add a user**
* Set as Username: *celery_user*
* Set as Passowrd: *celery_password*
* Set as Tags: *management*
* Click button **Add User**

#### Set permissions for created user
Login in [RabbitMQ Manager Tool](#using-rabbitmq-manager-tool)

Edit the created user: *celery_user*

In **Permissions** section, set as *Virtual Host* the value: /

Click the button **Set permission**

### Using Celery Browser
[Start the stack with Docker](#start-the-stack-with-docker)

Visit url http://localhost:8008/