/django-daphne-redis-mysql-docker

Working Django Chat project with Daphne Channels, Redis MySQL all dockized

Primary LanguagePythonMIT LicenseMIT

django-daphne-redis-mysql-docker

Working Django Chat project with Daphne Channels, Redis and MySQL. Dockerized!

Sources

https://docs.djangoproject.com/en/4.2/howto/deployment/asgi/daphne/
https://channels.readthedocs.io/en/stable/

Inspired on

It's just an adaptation of this tutorial:

https://channels.readthedocs.io/en/stable/tutorial/part_3.html

Execute

docker compose build
The first time or everytime you want to rebuild the container

docker compose up
Just run the container

Local

You may also execute it locally by creating a local environment:

virtualenv .venv
.venv\Scripts\activate.bat (for windows)
pip install -r requirements.txt

then execute the docker, stop the Daphne service and run the server locally.
The rest of the services will be pulled from the container.