Note: Please checkout Astra™ Database setup on astra branch if you don't want to setup Apache Cassandra™ locally on your system.
There are two requirements to setup this project.
- Docker™
- Virtual Environment
Note: Make sure you have setup Cassandra™ database before starting the Django Server
- Create a Bridge Network
sudo docker network create -d bridge runn-network
- Create Cassandra™ Database
sudo docker container run --name runn-IN-1 --network runn-network -e MAX_HEAP_SIZE="1G" -e HEAP_NEWSIZE="256M" -d cassandra:latest
Clone this repository and follow the steps below
Add a
.env
file in thesrc
folder before proceeding and paste the contents from.env_sample
- Get your cassandra host network IP
sudo docker inspect runn-network
"Containers": {
"9184a78b0ccb6f2993407d3a9858fc9f28ce2dfce0b3a1c1bba51fd0d3f351e1": {
"Name": "runn-IN-1",
"EndpointID": "0432eacdf5859f0cf2aea94cb6adb400b88e79d7457945c430a14a8a9f522386",
"MacAddress": "02:42:ac:12:00:02",
"IPv4Address": "172.18.0.2/16",
"IPv6Address": ""
}
}
Also replace the
HOST
insettings/dev.py
with aboveIPv4Address
you will get.
- Navigate to the cloned repository and paste the following in your shell
sudo docker-compose run backend python src/manage.py sync_cassandra
- Run Django Server
sudo docker-compose run -p 8000:8000 backend
- This step is only required when you cannot connect to your Docker™ image from VSCode™
pip3 install virtualenv
- Create virtual environment
virtualenv venv
- Activate Virtual Environment
source venv/bin/activate
- Install Project Dependencies
pip install -r requirements.txt
- Add Astra™ Connection