Skip to content

godd9170/shakespeare-backend

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Shakespeare-backend

CircleCI

Getting Started

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.

Create a Virtual Env + Install Packages

  1. Get virtualenv

sudo pip install virtualenv

  1. Create a new virtual env in python 3

virtualenv -p python3 shakespeare-venv

  1. Install all the requirements

pip install -r requirements.txt

Create a local Dev DB

shakespeare-backend uses postgres, so you'll need to set up a local psql server in order to run it.

  1. Create a new local db
psql
CREATE DATABASE shakespeare-dev;
  1. Create a db new user and allow them to make new DBs (for testing)
CREATE USER shakespeareadmin WITH PASSWORD 'salesforce1';
ALTER USER shakespeareadmin CREATEDB;

Redis and Celery

  1. Starting Redis
redis-server &
  1. Starting Celery workers

From the project's root folder (the one containing manage.py) run:

celery worker -A shakespeare --loglevel=INFO

Elastic Beanstalk Deploys

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

Notable Libraries

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages