Brought to you by the 5CHackathon at the Claremont Colleges.
This guide assumes that you are working on a Mac or Linux computer. If you're on Windows (or just want to check out a neat, web-based development environment), we recommend creating a workspace at Cloud9. This will help to simplify the steps to get started!
-
To begin, open up a new Terminal window. (On Macs, you can use
cmd+spacebar
or search for it in Spotlight.) -
Install
pip
which is a Python package manager. On the command-line, type:$ sudo easy_install pip
As a general note, the
sudo
command should be treated very carefully. It allows you (or code you run with it) to operate at essentially the root-level of your computer where you (or some malicious install scripts) could do significant damage to your computer!After pressing enter, proceed by typing in your password.
-
Now that
pip
is installed, we will install a Python package with it calledvirtualenv
with the following command:$ pip install --user virtualenv
The
--user
flag tellspip
to only install it to your account instead of globally on your system and does not requiresudo
privledges. -
Now clone this repo with the following command:
$ git clone https://github.com/5chackathon/hackweek-intermediate-webdev-sp2016.git hw-webdev
-
Change your working directory to that of the clone repo:
$ cd hw-webdev
-
Create a new Python virtual environment:
$ python -m virtualenv env
-
Activate the virtual environment:
$ source env/bin/activate
If you want to deactivate your virtual environment at any point, simply use the
deactivate
command. -
Install this project dependencies:
(env)$ pip install -r requirements.txt
-
Go to https://www.yelp.com/signup.
-
Sign up for an account (and make sure to confirm it via email).
-
Acquire an API Key by visiting the Manage API Keys page.
For Website URL use
http://localhost:5000
since we will only be running this app on our local machines. -
Once successfully submitting the form, you should see four different keys/secrets listed. We will come back to them later in the workshop, so copy and paste them somehwere safe or leave this tab open.
API Keys and secrets should be treated as if they are a password to your account. Never commit your secrets into a source control repository where they could be publicly accessed. Generally, avoid hard coding keys/secrets into your code -- even if it is just to quickly test!
At this point, you should be ready to get started on the project. If at any point you have questions -- including questions about any of the setup above -- please let us know and we would be more than happy to answer them!