Skip to content

Backend for TruthTree - an interactive, map-based data viz tool displaying the breakdown of government spending and related metrics. One-stop shop to gauge public investment effectiveness.

Notifications You must be signed in to change notification settings

benbenbuhben/TruthTreeAPI

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TruthTree

The TruthTree Python backend

Requirements

  1. Python 3.7
  2. Django 2.x
  3. Pipenv
  4. PostgreSQL 9.x+

Development

$ pipenv --python 3.7       # creates virtual env
$ pipenv install --dev      # install dependencies
$ cp .env.sample .env       # configure your .env file
$ make migrate              # run migrations for existing apps
$ make start                # start server

Deployment

$ docker build -t truthtree .
$ docker run -p 8000:8000 truthtree

Setting Up VSCode

https://code.visualstudio.com/docs/python/environments

$ pipenv --venv             # where your virtual env exists
$ code .                    # start VSCode

Then select the interpreter where your virtual env exists. Looks something like this:

/Users/elusive/.local/share/virtualenvs/django-bootstrap-trBOeQwu

Appendix

Starting from Scratch @ben @lantz

$ pipenv --python 3.7
$ pipenv install django djangorestframework psycopg2 python-dotenv
$ pipenv run django-admin startproject backend .
$ pipenv run django-admin startapp api
(create database)
(configure database - see settings.py)
$ pipenv run python3 manage.py migrate
$ python manage.py createsuperuser --email [email protected] --username admin
$ pipenv run python3 manage.py createsuperuser --email [email protected] --username admin

About

Backend for TruthTree - an interactive, map-based data viz tool displaying the breakdown of government spending and related metrics. One-stop shop to gauge public investment effectiveness.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 94.9%
  • Dockerfile 3.8%
  • Makefile 1.3%