-
Notifications
You must be signed in to change notification settings - Fork 3
Tutorial 02 Environment
For this tutorial we are going to use Python for creating a webserver, so before we start, we should take some time setting-up our development environment.
The very first thing to do is to install virtualenv
if you don't already have.This is a really useful utility for creating sandboxed python installations.
sudo pip install virtualenv
Then, create a new sandbox for our tutorial and enter inside it:
virtualenv vmcp --no-site-packages
cd vmcp
source bin/activate
Now you are ready to install the python libraries that we are going to need:
pip install flask m2crypto
Hint: If you have problems installing m2crypto
you can try installing pycrypto
or rsa
. Any of these RSA libraries can be used.
For the purpose of this tutorial we are going to need a domain for which an authorization key is issued. The tutorial files already contain a private key for the domain test.local
, so we will need to put an alias of this domain name to the localhost IP address.
To do this you will need to add to your machine's hosts file the following line:
127.0.0.1 test.local
To edit this file on windows:
- Open notepad with administrator privileges
- Open the C:\Windows\System32\drivers\etc\hosts
Or on Mac OSX / Linux:
- Open a terminal
- Type sudo nano /etc/hosts
- When done, press
CTRL+X
,Y
andENTER
to save
All the tutorial files is located on the github repository of cernvm-webapi
, in the folder doc/tutorial
. Copy the contents of the entire folder in your virtualenv installation.