Slide decks and example code for Jack's September YSA presentation
If you're on Windows, it is highly recommended that you download the Git Bash Shell before starting. You can do some of the similar things in cmd, but it's just not the same. https://git-scm.com/downloads
If you're on Mac you can use the terminal. If you're on Linux, bonus cookies to you.
In bash, run
pip --version
to make sure you have pip installed. If not, you'll need to start by installing python. https://www.python.org/downloads/. I'm using 3.6.5 as my global interpreter for this project. If you use an older one (like python 2) I can't guaruntee if it will work.
The next step is to clone this git repo, which you can do with:
git clone https://github.com/Novacer/YSA-presentation.git
cd YSA-presentation # if the clone worked properly you should be able to go to this folder
Alternatively, you can fork it into your own github account as well.
To install the dependencies needed to run this project you can do
pip install -r requirements.txt
which will install the python stuff globally. Some of you may want to make a virtual environment so that these new dependencies don't conflict with your current python installation. (This is purely optional, though in software development it is seen as a best practice.) Here is how you can do it.
If you want to work on the Angular UI, you'll need to install the node_modules
for it as well. To do this do
cd example-ui/angular-frontend
npm install
Once you have all the dependencies installed you are ready to go.
I've conveniently written two bash scripts that will do most of the work for you. If you just want to run the APIs, do
# Method 1
source run_backend.sh
# Method 2
. run_backend.sh
The two methods are equivalent in bash.
You can run the angular in the same way, replacing run_backend.sh
with run_frontend.sh
Feel free to read the .sh
files to understand how this actually works.
In first_api.py
you may have noticed the line
weather = requests.get("http://api.openweathermap.org/data/2.5/weather?q=%s&APPID=API_KEY_HERE" % city)
For this endpoint to work properly you need to make an account at https://openweathermap.org/api and paste your API key where it says API_KEY_HERE