mkdir cafb_site
cd cafb_site
git clone https://github.com/cafbdk/cafb_site_with_restapi.git
cd cafb_site_with_restapi
Set up your local virtual env with virtualenv
virtualenv venv
source venv/bin/activate
pip install -r requirements/development.txt
Add your nutrix api key and api_id to sample.env and rename sample.env to .env
mv sample.env .env
python manage.py migrate
python manage.py createsuperuser
python manage.py load_initial_data
Install here https://toolbelt.heroku.com/
heroku local
Open http://localhost:5000/ in your browser
heroku create
heroku config:add api_key=(insert nutrix api key here)
`heroku config:add api_id=(insert nutrix api id here)``
git push heroku master
heroku run python manage.py migrate
heroku run python manage.py createsuperuser
heroku run python manage.py load_initial_data
heroku open
No tokens or keys required for this version of the API, but unless you are logged in, it's read only.
https://cafbsite.herokuapp.com/api/v1/
http://localhost:8000/api/v1/products/857063002645/
Should return {"gtin_code":"857063002645","gtin_name":"Korean Stir Fry","created":"2016-04-06T03:45:13.816144Z"}