Key terms

Milo Spencer-Harper
5 min readJan 19, 2016

--

This glossary is designed to accompany ‘A beginner’s guide to creating your first Python website using Flask, AWS EC2 & Elastic Beanstalk’.

Section 1 (Prerequisite understanding)

Python — A popular programming language. It was originally designed by Guido van Rossum in the late 1980s. Since then it has been upgraded and improved by the open source community. It is installed by default on a Mac. Python files end in the “.py” file extension.

Package — What if you want to extend the capabilities of Python? For example Python wasn’t originally conceived to create websites, so we will need to extend it’s capabilities using a package called ‘Flask’. These packages can also be called libraries.

Package manager — To install and manage your packages you need a package manager.

Easy_install — Python’s default package manager.

Pip — A much better package manager, that is much more widely used than easy_install. For Python 2 it is installed by default for Python 2.7.9 and above, and for Python 3 it is installed by default for Python 3.4 and above.

Virtualenv — Creates a virtual environment on your local computer, so each of your projects, has separate versions of its own packages. The alternative would be to install your packages globally on your computer, and share these packages between different projects. But this isn’t a good idea. To understand more about virtual environments I recommend this article.

AWS — Amazon Web Services. A collection of services for hosting and running websites provided by the company Amazon. We will use their EC2 service and Elastic Beanstalk service.

EC2 — Elastic Cloud Computing provided by Amazon. This allows you to purchase computing power on an as-need-basis, to run your website.

Elastic Beanstalk — A service offered by Amazon which simplifies deploying your code from your local computer to your EC2 instance on AWS.

Flask — A Python package that allows us to extend the capabilities of Python, to create a website. Flask is an example of a web framework.

Terminal — A software programme that is installed by default on a Mac. It is available from Finder > Applications > Utilities > Terminal. You can use it to install software, modify files on your computer and many other things. It is used heavily in software development. The software which runs inside your Terminal on a Mac is called bash. If you haven’t already, I recommend dragging the Terminal into your Dock, for easy access. To run a command in the Terminal, type it into the Terminal, then press Enter. The Terminal will then respond with a message.

Sudo — On a Mac, some folders and files are protected. If you want to modify them you need to do so as an administrator. When typing a command in the Terminal you can prefix it using the word“sudo”. The Terminal will ask you for your Mac password and then it will run the command with administrator privileges.

Sublime — You can write software code in any text editor. Sublime is a popular text editor for writing software code. It highlights the code in colours to make it easier. You can install it for free from their website http://www.sublimetext.com/.

git — This is a popular source control system. It allows you to save a history of your code. It gives you a similar capability to the “Undo” button in Microsoft Word. However, it also enables you to easily share your repository containing your code with other developers. In order for Amazon Elastic Beanstalk to work you will need to use git.

SourceTree — This is a application which allows you to visually use git. You don’t have to use SourceTree to use git, instead you can use the git command line interface in the Terminal. However, for beginners it is easier to visually see your commits and understand how git works by using SourceTree. You can install it for free from their website https://www.sourcetreeapp.com/.

Section 2 (For understanding step 21)

HTML — Stands for hyper text language markup language. I’ll explain it this way. Microsoft Word opens “.docx” files. Internet browsers open “.html” files. All the pages you visit are written in HTML. You can inspect the HTML code of this web page by double clicking and selecting ‘View Source’. You will see it is made up of HTML tags, which look like this <tagname></tagname>. Examples of HTML tag are <p> (paragraph), <a> (link) and<h1> (title).

function- A function is a block of Python software code which starts with the word ‘def’. The word ‘def’ stands for define. Functions can take input parameters, which are listed inside the brackets. They can also output a value, using the ‘return’ command.

We can declare a function like this:

def isayhello(name):
return “Hello “ + name “, it’s good to meet you.”

We have named the function ‘isayhello’. It takes a single input parameter, which we have named ‘name’. And it returns text.

We can call the function like this:

isayhello(“Sarah”)

Which will output this text:

“Hello Sarah, it’s good to meet you.”

decorator — a decorator is a feature in Python which adds additional functionality to a function. They are attached to a function using the “@” symbol. For example, this is a decorator:

@iamadecorator
def iamjustanordinaryfunction():
return “I’m just an ordinary function.”

How a decorator is defined and how it works is complicated. So I won’t explain the internal workings here. But I thought it would be good to let you know about them, because we use a Flask decorator in step 21.

Section 3 (For understanding step 55)

environment — An AWS application might have multiple environments. For example a production environment for customers and a development environment for testing.

DNS record — Computers connect to websites using IP addresses. For example 104.16.120.127 is the IP address for the Medium website. However, that’s a bit difficult to remember, so instead we type in www.medium.com into our Internet browser. To enable this to work, Medium have set up a DNS (Domain Name Sever) record to point www.medium.com to 104.16.120.127. Whenever you use the Internet by visiting a website, the URL is being resolved to an IP address by a DNS record. You’re just not aware of it.

CNAME — A CNAME is a type of DNS record. So when Amazon Elastic Beanstalk asks you what CNAME you would like to use, they are effectively saying “Your website will be available at http://xyz.elasticbeanstalk.com what would you like xyz to be?”.

--

--

Milo Spencer-Harper

Studied Economics at Oxford University. Founder of www.magimetrics.com, acquired by www.socialstudies.io. PM at Facebook. Interested in machine learning.