The best way to develop this API is with a python3 virtual environment. I like to keep the venv within this repo (it's .gitignored so long as you call it *-venv or ENV) such that the tree looks like this:
.
├── ENV
│ ├── bin
│ ├── include
│ ├── lib
│ └── pip-selfcheck.json
├── README.md
├── requirements.txt
└── shakespeare
└── manage.py
Instructions on setting up a virtual environment can be found below.
- Get virtualenv
sudo pip install virtualenv
- Create a new virtual env in python 3
virtualenv -p python3 shakespeare-venv
- Install all the requirements
pip install -r requirements.txt
shakespeare-backend
uses postgres, so you'll need to set up a local psql server in order to run it.
- Create a new local db
psql
CREATE DATABASE shakespeare-dev;
- Create a db new user and allow them to make new DBs (for testing)
CREATE USER shakespeareadmin WITH PASSWORD 'salesforce1';
ALTER USER shakespeareadmin CREATEDB;
- Starting Redis
redis-server &
- Starting Celery workers
From the project's root folder (the one containing manage.py
) run:
celery worker -A shakespeare --loglevel=INFO
Obtain ebcli tools with
pip install awsebcli
Make sure that you've got an AWS account, and your credentials are environment variables named
export AWS_ACCESS_KEY_ID=xxx
export AWS_SECRET_ACCESS_KEY=xxx
Make sure that whatever elastic beanstalk url is generated, is put into the shakespeare.settings
ALLOWED_HOSTS
eb deploy
Used to a) authenticate users into the app, b) permit access to the gmail SMTP server.
Handles the exposure of the shakespeare API
A schema that defines organizations so we can share shakespeare resources across multiple users of a common account.
The genius behind marrying social-app-django
and django-rest-framework
. Offers a 'convert' endpoint that turns the access token from the client into an auth with our api.
Allows us to make requests to our API from javascript on an alternate domain