Glowing Enigma REST API code.
- Python 3.x
- Django Web framework
- Django REST
After you have cloned into the project cd into the dir with the Vagrant file, then do the following:
- Vagrant up
- Vagrant ssh
- cd /vagrant/
- python -m venv ~/env
- source ~/env/bin/activate
- pip install -r requirements.txt
- python manage.py runserver --noreload 0.0.0.0:8000
-
Within the settings.py file under the profiles_project dir, you will need to edit the "allowed hosts". Place your EC2 Public DNS IPv4 address here and add 127.0.0.1 so the API server will run on both your EC2 and your local.
-
Configure your Ubuntu 18.01 LTS EC2 instance via AWS console and setup your ssh key.
The deployment is for an Ubuntu 18.01 LTS EC2. You will need to ssh into your EC2 instance and then perform the following:
- Download and run the setup.sh via curl from the repo.
- curl -sL https://raw.githubusercontent.com/ryancarolina/glowing-enigma/master/deploy/setup.sh | sudo bash -
- After any changes are pushed to the repo, run the update.sh to pick up the changes on the EC2 instance.
- The update.sh script needs to be ran after local changes are made as well to restart the API server.
- /usr/local/apps/profiles-rest-api$ sudo sh ./deploy/update.sh