-
Install prerequisites
sudo apt-get update $ sudo apt-get install python-pip python-dev build-essential libpq-dev postgresql postgresql-contrib virtualenv virtualenvwrapper $ export LC_ALL="en_US.UTF-8" $ pip install --upgrade pip $ pip install --upgrade virtualenv
-
Access Postgres Prompt
sudo -u postgres psql
-
Create the database
CREATE DATABASE cdr_analysis;
-
Assign all rights to user
GRANT ALL PRIVILEGES ON DATABASE cdr_analysis TO postgres;
-
Exit postgres
exit
-
Create a python 3 virtual environment
virtualenv -p python3 venv
-
Activate the virtual environment
source venv/bin/activate
-
Install the project's dependencies
pip install -r requirements.txt
-
Run the database migrations
python manage.py migrate
-
Copy the default CDR schema
python manage.py loaddata cdr_schema.json
-
Copy the default BTS schema
python manage.py loaddata bts_schema.json
-
Create a superuser
python manage.py createsuperuser
-
Install front-end dependencies
npm install
-
Run the code watcher
npm run watch
-
Start the django development server
python manage.py runserver
Follow the guide at DEPLOY DJANGO APP: NGINX, GUNICORN, POSTGRESQL & SUPERVISOR