Part 0: Setup for APIs

Setting up our environment for the API tutorial.

IMPORTANT: Please be sure to work through the machine setup before proceeding.
Need to cheat a bit? The complete API script can be found in new-coder/apis.

Within your terminal, change into the complete APIs project:

1
$ cd new-coder/apis

Make sure you’ve installed virtualenvwrapper and followed the steps from the machine setup to set up your terminal correctly.

Make a new virtual environment specific to your API project project:

1
$ mkvirtualenv APIProj

You should now see (APIProj) before your prompt. Now, from within the new-coder/apis directory, run the following to install package requirements with the following command for this project:

1
(APIProj) $ pip install -r requirements.txt

Your virtual environment will store the required packages in a self-contained area to not mess up with other Python projects.

Lastly, navigate to your project workspace that you setup earlier from the machine setup:

1
2
(APIProj) $ cd ..
(APIProj) $ cd api_workspace

And then create an empty Python file for your project code:

1
(APIProj) $ touch api.py

And finally open up api.py within your own text editor.