Python for Entrepreneurs Transcripts
Chapter: Deploying to the cloud
Lecture: Updating resources

Login or purchase this course to watch this video and the rest of the course contents.
0:01 We've been through a whole lot in this chapter, let's take a look back
0:03 on what we have accomplished so that you'll know how to keep evolving
0:06 your deployment as you continue to build your business.
0:08 When we started out, at the beginning of this chapter
0:11 this was the situation- we had built an application
0:13 but it was sitting on your local machine, customers had no way to get to it
0:16 because you're not going to run your application off of your local development environment.
0:19 By the end of the chapter, we had set everything up on our Digital Ocean server
0:23 we put many, many pieces in place and the best part is
0:27 we automated it all with Ansible, whenever you want to deploy and update
0:30 you can just rerun the Ansible playbook,
0:33 Ansible playbook follows a principle known as item potency,
0:37 item potency sounds like a fancy word, but all it means is
0:40 that we can run the playbook over and over again,
0:43 and it will continue to work because the changing state of our deployment
0:47 will not impact the ability for the playbook to function.
0:51 For example, if we already have our virtual environment set up
0:54 we'll simply skip that step, because we don't need to create a new virtual environment
0:58 we've either used the Ansible modules that handle changing state
1:02 or we've built checks into our playbook,
1:05 to determine if our server is in one state or another and handle that appropriately.
1:10 Make sure that as you continue to update the Ansible playbook,
1:12 you keep in mind what happens after the first time you run your playbook,
1:17 are you depending on your server being in a certain state,
1:20 what if it is not in that state, what if you don't have a system package installed,
1:25 what if you've already created a certain directory.
1:28 Make sure that you can run your Ansible playbook over and over again
1:31 and it will continue to be successful in setting up your application.
1:34 With that, I want to provide a few more resources,
1:37 a couple of them are of course full stack python,
1:40 the first one being the deployment page, there is a slew of resources on there
1:43 if you want to get into continuous integration,
1:45 and other more advanced deployment setups,
1:47 you should also check out the wsgi server's page,
1:50 to better understand how Python applications are run in our deployment,
1:53 we use waitress, there are other wsgi server implementations out there,
1:56 like green unicorn and mod wsgi, so you can learn more about that
2:00 both on the deployment and the wsgi server's pages.
2:02 All of the files that we've used throughout this chapter
2:05 are stored within the deployment directory
2:07 of the Python for Entrepreneurs course demos,
2:09 you should be able to copy and paste the code examples
2:12 from the Ansible code examples rather than having to type everything in manually
2:16 and so hopefully that'll help you get up and running even faster.
2:20 And then, finally Michael and I did an episode on deploying python web applications
2:24 that talks about other bits that you can deploy, such as nosql databases,
2:27 task queues, other code libraries that you may want to consider using,
2:31 as you build out your application, and if you run into any trouble
2:34 please hit me up at @fullstackpython, on twitter.
2:37 Now you can stop worrying about getting your application up and running
2:40 and get back to building your business.