Python for Entrepreneurs Transcripts
Chapter: Deploying to the cloud
Lecture: Introduction to deployment

Login or purchase this course to watch this video and the rest of the course contents.
0:01 You've got your application built, and you're ready to go, ready to launch.
0:04 But it needs to be hosted somewhere, we can't just run it off your local laptop;
0:08 that's where deploying web applications comes in.
0:12 The deployment is a huge topic, the goal for this chapter
0:15 is not to make you an expert in devops and deployments,
0:18 but instead to have some practical experience
0:21 getting your application shipped and allowing you
0:24 to ship constantly, as you make improvements to your code.
0:27 We'll keep this as simple as possible, each video
0:29 is going to focus on one aspect of the deployment
0:32 and just about everything is going to be hands on,
0:35 at the command line, rather than a whole bunch of theory.
0:37 Here's what we're going to cover: first off,
0:39 you need a server somewhere that is going to host your application.
0:42 And we use a cloud service to do that,
0:45 in this case, we're going to use Digital Ocean.
0:47 I've also used services like Linode in the past,
0:50 and the idea here is we're just going to get a single server,
0:52 and deploy our application on it, we're not going to use
0:55 an infrastructure as a service provider like Amazon web services or Azure,
0:58 we'll keep it simple, just have a single server that allows us plenty of scale,
1:01 and is more secure because it's only a single box
1:04 that we're going to lock down against malicious actors.
1:07 Once your infrastructure expands to multiple machines,
1:10 there's more attack factors, so in this case we'll keep it simple,
1:13 we'll keep it straightforward so that your application can be as secure as possible,
1:17 without having to learn too much about web server security.
1:20 Once we provision our server, we'll install an operating system,
1:24 we'll start to configure that operating system for a deployment user
1:26 and make sure it's locked down and ready for the rest of deployment
1:29 which will have a web server, and in the Python world
1:32 what's known as a wsgi server, web server gateway interface,
1:36 it is a standard interface between an application like the one that you built,
1:40 and the server which is actually executing the code, that's a wsgi server,
1:44 it pretty much runs your web application, if you're in the Python ecosystem.
1:48 We will get all that set up, along with the application dependencies,
1:51 so whatever specific libraries and frameworks that you're using,
1:54 for example Pyramid we'll be able to install those
1:57 on the server that's running the code, so your application will run
2:00 just like it does on your local machine.
2:03 Throughout the deployment we're going to use Ansible,
2:05 a configuration management tool that is built in Python
2:08 to automate every step throughout this process.
2:10 The first deployment that we do will be automated
2:12 so that subsequent deployments can be done
2:15 with a single command from the command line.
2:17 Ansible has some core concepts like playbooks and tasks
2:20 that we'll review and then we're going to write all of our tasks
2:23 within these Ansible playbooks and you'll be comfortable
2:26 adding extra steps as your business grows and expands,
2:28 and you want to change your application over time. 02:31 Let's dive into getting your application up and running.