ACM Profiles API (Side Projects Sage Team)
REST API for ACM Profiles. Built using Django and PostgreSQL.
Unfortunately Heroku is taking down their free tier so the hosted version of this API will no longer be functional.
- Python 3 and pip - instructions
- Docker - instructions
- docker-compose - instructions
- PostgreSQL - instructions
- Install pipenv, a tool which automates virtual environments for python.
- Clone the repository:
git@github.com:acmucsd/acm-profiles-api.git
- Navigate to the project directory:
cd acm-profiles-api
- Create
.env
file, using.env.example
as a template :cp .env.example .env
. - Fill out the
.env
. See the example file below. - Run
pipenv sync
to install all the dependencies andpipenv shell
to activate the virtual environment. - Run the docker container:
docker-compose up -d
. - Make migrations to the database:
python manage.py migrate
. - Load the test data:
python manage.py loaddata */fixtures/*.json
. - Run the local testing server:
python manage.py runserver
. - Follow setup instructions for the
membership portal api
Make sure that your databases for acm profiles and the membership portal are running on different ports. As a suggestion, use 5433 for acm profiles and 5432 for the membership portal. The two servers need to run on different ports as well. ACM profiles defaults to 8000, so run the membership portal on a different port, such as 3000.
SECRET_KEY=secret_key
DATABASE_URL='postgres://user:password@localhost:5433/name'
DOCKER_DB_PORT='5433'
DOCKER_DB_NAME='name'
DOCKER_DB_USER='user'
DOCKER_DB_PASSWORD='password'
MEMBERSHIP_PORTAL_API='http://localhost:3000/'
FRONT_END_URL='http://localhost:3005'
HOST=127.0.0.1
DEBUG=True