This Profile API is a Django REST Framework based API that provides basic functionality for managing user profiles.
Python (2.7, 3.2, 3.3, 3.4, 3.5, 3.6)
Django (1.10, 1.11, 2.0)
Vargant
VirtualBox
Running vagrant file
- Change directories to Vagrant fold inside project.
- Run
Vagrantfilewith commandvagrant up - ssh into vagrant server with command
vagrant ssh
Make sure you are in the same directory as the Vagrantfile when you use
the vagrant command. When you run all the vagrant file all the environment
setting, variables, and dependencies with be installed for the project.
We will importing all the required libraries into our python environment that is needed to build and run the api.
- Create python virtual environmant in vagrant box if doesn't not exist
mkvirtualenv profiles-rest-api - Activating the python environment if not already activated
workon profiles-rest-api - Change directories to project folder
cd /opt/workspace/Profiles-rest-api/ - intall all requiremenets
pip install -r requirements.txt
By using Django rest framework we are able to setup database based on the model, migrate any changes, run service, and debug while developing.
- Make sure that the python env is activate if not then
workon profiles-rest-api - Change directories to project folder
cd /opt/workspace/Profiles-rest-api/src/profiles_project - Command for creating DB Migration
python manage.py makemigrations
Make sure you have the vagrant server running, your ssh into the server, have the python env activate, and you are in the correct direct
- Activate the python virtualenv with command
workon profiles-rest-api - Change directory to the project folder
cd /opt/workspace/Profiles-rest-api/src/profiles_project - Make sure that the database configuration is up to date with command
python manage.py makemigrations - Run Python Django development server to host api
python manage.py runserver 0.0.0.0:8081
Link for local machine: