awesome-release / django-celery

A dockerized example showcasing the use of django and celery

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Click to view on Youtube

Architecture

Architecture Diagram

This demo was created by @oisinBates to orginally showcase the celery_progress package. Here we have modified it to run fully in docker to be used in Release.

Getting Started

Environment Variables

Generate an API key at api.nasa.gov and add it to a .env file in the root directory as NASA_API_KEY (see .env.example).

Running the Application

Docker Method

Simply run the following in a terminal:

docker-compose up -d

After that, visit localhost:8000 to see the app running!

Running manually

Start RabbitMQ and Redis on Docker

docker run -d -p 5672:5672 rabbitmq
docker run -d -p 6379:6379 redis

From within this repo's root directory, run the following commands in order to install this project's dependencies in a virtual environment and run a Django web server:

pip install --user pipenv
pipenv shell
pipenv install
python3 manage.py runserver

Open a second terminal window and run the following:

python3 -m celery -A demo_project worker -l info --concurrency=8

About

A dockerized example showcasing the use of django and celery


Languages

Language:Python 66.0%Language:HTML 32.0%Language:Dockerfile 1.6%Language:Shell 0.4%