- Clone the repo
git clone https://github.com/tapilab/ant.git - Create and enter a virtual environment
virtualenv ant-v
source ant-v/bin/activate
- brew install openssl
- Create .env file with settings for:
- DJANGO_SETTINGS_MODULE=ant.settings
- REDISCLOUD_URL=[..]
- OBJC_DISABLE_INITIALIZE_FORK_SAFETY=YES
- Install requirements
cd ant
pip install -r requirements.txt
- Setup postgres
heroku local
This will run the server locally at port 8089 http://0.0.0.0:8089/
On first run, there will be no data. Go to the config page and enter the URL of a public-viewable Google Sheet in the ANT format. This will populate the database.
Whenever you change the models, you'll need to migrate the database to reflect those changes.
- make migrations:
heroku local:run python manage.py makemigrations: This will write.pyfiles todocketdashboard/migrations - migrate:
heroku local:run python manage.py migrate: This will run those.pyfiles to actually update the database.
heroku local notebook
To configure the notebook to be able to access the Django models:
import sys
sys.path.append('../') # Assuming your notebook is in the nbs/ folder, we add the ant root project to the path.
import django
django.setup()