This project provides some basic realtime usecases based on Django & Django Channels. Currently two main usecases are included:
- World Wide Realtime Click Counter
- Google Note Clone Lite (Realtime Synchronization for world wide users)
The Tech-Stack is based on Python, Django, Postgres and Redis. This repository includes also a Dockerfile and a docker composition for easy kick-starts.
Have fun & Play around.
There are two setup possibilities included:
- local setup
- docker setup (recommended)
General Setup You will need following steps, doesn't matter if you gonna use this setup in local requirements or containerized:
- Clone this repository
git clone https://github.com/Codingplace42/Clicky.git
- Init submodule
git submodule init
- Update Submodule (this will pull the used SB-Admin-2 Repository for Frontend)
git submodule update
- Create
.env
File by copying the example file:
cp clicky/.env.example clicky/.env
Change the values inside of that file depends on the setup what you want to use.
- Python v. 3.6 or higher is required
- PostgresQL Database (optional - alternative: Change DB Settings to Sqlite)
- Redis
- Install Requirements
pip install -r requirements.txt
Note: A virtual environment is recommended here
- Migrate the database
python manage.py migrate
Note: Make sure that correct parameters in your .env file are set
- Start Server
python manage.py runserver
- Docker
- Docker Compose
- Start docker composition
docker-compose up
Note: Make sure that correct parameters in your .env file are set
About The Docker Setup Services for Postgres, Redis and Nginx are included in the docker-composition. Make sure that you've used the correct ports in your .env file for being able to communicate between services.
Cheat For local development I do recommend to start redis and postgres via docker setup and run the django project separate in local configuration.