Skip to content

Latest commit

 

History

History
88 lines (66 loc) · 2.4 KB

README.md

File metadata and controls

88 lines (66 loc) · 2.4 KB

Runn Backend :tw-1f3c3:

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.

  1. Docker™
  2. Virtual Environment

Note: Make sure you have setup Cassandra™ database before starting the Django Server


Docker™ setup for Apache Cassandra™ Database

  • 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 the src 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 in settings/dev.py with above IPv4Address you will get.

1. Docker™ Setup for Django server

  • 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

2. Virtual Environment Setup for Django server

  • 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

TODOs:

  • Add Astra™ Connection